A lightweight 3D vector class in C++ with basic linear algebra operations.
- Vector addition & subtraction
- Dot and cross product
- Magnitude & normalization
- Scalar operations
- Angle & projection
- Usage
Vec3 A(1,1,0); Vec3 B(1,0,0); cout << A + B << endl; cout << A.dot(B) << endl; cout << A.cross(B) << endl; cout << A.unit() << endl;