Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "CartesianVectors.h"
- template <typename T> CartesianVector<T>::CartesianVector(T X, T Y)
- {
- x = X;
- y = Y;
- }
- template <typename T> CartesianVector<T> CartesianVector<T>::operator+ (const CartesianVector<T> other)
- {
- T tempX = this.x + other.x;
- T tempY = this.y + other.y;
- return CartesianVector<T>(tempX, tempY);
- }
- template <typename T> CartesianVector<T> CartesianVector<T>::operator- (const CartesianVector<T> other)
- {
- T tempX = this.x - other.x;
- T tempY = this.y - other.y;
- return CartesianVector<T>(tempX, tempY);
- }
- template <typename T> CartesianVector<T> CartesianVector<T>::operator* (const CartesianVector<T> other)
- {
- T tempX = this.x * other.x;
- T tempY = this.y * other.y;
- return CartesianVector<T>(tempX, tempY);
- }
Add Comment
Please, Sign In to add comment