项目作者: rfranco84

项目描述 :
C++ Class for 2D vectors capable of doing basic vector operations with various operators being overloaded.
高级语言: C++
项目地址: git://github.com/rfranco84/Vector2D.git
创建时间: 2020-02-19T08:28:30Z
项目社区:https://github.com/rfranco84/Vector2D

开源协议:

下载


Vector2D

C++ Class for 2D vectors capable of doing basic vector operations with various operators being overloaded.

Developed in Visual Studio 2019.

Vector2D.cpp contains the main function and is used to test the Vector2 class.

Use the + operator to add two Vector2 objects
For example:
v+u

The - and operators work similarly. The operator will compute the dot product.

The class is also able to print vectors in (x,y) cartesian coordinates and (magnitude, radiants) polar coordinates. Additionally these four numbers (x,y,mag,dir) are updated accordingly as the vectors are manipulated (i.e., if a magnitude changes, or if a direction changes, etc).

Other operations include normalizing a vector and calculating normal vector.

TO DO:
*Implement a rotation function that rotates a Vector2 object v by dir radiants:
static void rotate(double dir)

*Implement a function to print vectors in component form in unit vector form:
void printVector2UnitVector()