#include // For sqrt function #include using namespace std; class vector2d { public: double x, y; double magnitude(){ return sqrt(x*x + y*y); } }; int main(){ vector2d t; t.x = 1; t.y = 1; cout << t.magnitude() << endl; }