Class Vector

Inheritance Relationships

Base Type

Class Documentation

class Vector : public Point

Represents a vector in 2D space, inherits from the Point class. It provides all basic functions with vectors in 2D.

Public Functions

Vector() = default

Construct a new Vector object.

Vector(const Point &a, const Point &b)

Construct a new Vector object from two Point(s).

Parameters:
  • a[in]

  • b[in]

Vector(const double &x, const double &y)

Construct a new Vector object from the two coordinates.

Parameters:
  • x[in]

  • y[in]

inline double dot(const Vector &v) const

Returns the dot product between the implicit Vector and v.

Parameters:

v[in]

double angleWith(const Vector &v) const

Returns the angle that the implicit Vector makes with v.

Parameters:

v[in]

Vector rotClock() const

Returns a Vector rotated clockwise 90 deg.

Vector rotCounterClock() const

Returns a Vector rotated counterclockwise 90 deg.

Public Static Functions

static bool pointBehind(const Point &futPos, const Point &actPos, const Vector &dir)

Checks if the Point actPos is behind futPos along the direction dir.

Parameters:
  • futPos[in]

  • actPos[in]

  • dir[in]