Question: Write a C++ class Vector2, that stores the (x,y) coordinates of a two dimensional vector, where x and y are of type double. Show how
Write a C++ class Vector2, that stores the (x,y) coordinates of a two dimensional vector, where x and y are of type double. Show how to override various C++ operators in order to implement the addition of two vectors (producing a vector result), the multiplication of a scalar times a vector (producing a vector result), and the dot product of two vectors (producing a double result).
Step by Step Solution
3.42 Rating (161 Votes )
There are 3 Steps involved in it
class Vector2 public double x double y Vector2 Vector... View full answer
Get step-by-step solutions from verified subject matter experts
