9 #include <boost/array.hpp> 11 #include "../misc/serializable.hpp" 42 void Set(
double ix,
double iy);
86 template<
class Archive>
100 (
const vector<double>& data);
232 #endif // GEOMETRY_HPP double distance(Vector2D const &v1) const
Caluclates the distance from the Vector to v1.
Vector2D operator/(Vector2D const &v, double d)
Scalar division.
Vector2D Reflect(Vector2D const &v, Vector2D const &axis)
Reflect vector.
size_t getChunkSize(void) const
Returns the size of array needed to store all data.
void Rotate(double a)
Rotates the vector in an anticlockwise direction.
double CrossProduct(Vector2D const &v1, Vector2D const &v2)
Returns the z component of the cross product of two vectors.
Vector2D operator-(Vector2D const &v1, Vector2D const &v2)
Term by term subtraction.
double y
Component in the y direction.
vector< double > serialize(void) const
Convert an object to an array of numbers.
Vector2D pol2cart(double radius, double angle)
Converts from polar coordinates to cartesian coordinates.
Vector2D & operator+=(Vector2D const &v)
Addition.
double Projection(Vector2D const &v1, Vector2D const &v2)
Calculates the projection of one vector in the direction of the second.
double ScalarProd(Vector2D const &v1, Vector2D const &v2)
Scalar product of two vectors.
Base class for a serializable object.
Vector2D normalize(const Vector2D &v)
Normalized a vector.
Vector2D operator*(double d, Vector2D const &v)
Scalar product.
Vector2D & operator*=(double s)
Scalar product.
void Set(double ix, double iy)
Set vector components.
Vector2D & operator-=(Vector2D const &v)
Subtraction.
Vector2D(void)
Null constructor.
Vector2D & operator=(Vector2D const &v)
Assigment operator.
double abs(Vector2D const &v)
Norm of a vector.
Vector2D calc_mid_point(Vector2D const &v1, Vector2D const &v2)
Calculates the mid point between two vectors.
void unserialize(const vector< double > &data)
Convert an array of numbers to an object.
double CalcAngle(Vector2D const &v1, Vector2D const &v2)
Returns the angle between two vectors (in radians)
double fastabs(Vector2D const &v)
Norm of a vector, less accurate.
Vector2D operator+(Vector2D const &v1, Vector2D const &v2)
Term by term addition.
double x
Component in the x direction.
Vector2D zcross(Vector2D const &v)
Cross product of a vector in x,y plane with a unit vector in the z direction.
double dist_sqr(const Vector2D &v)
Calculates the square of the distance. This is computationaly cheaper then actually calculating the d...