|
| | Point2D () |
| | A Point2D defaults to (0,0).
|
| |
| | Point2D (int _x, int _y) |
| | Initialize a Point2D At (_x, _y).
|
| |
| | Point2D (const Polar2D &pol) |
| | Initialize a Point2D from a Polar2D coordinate.
|
| |
| int | X () const |
| | Return the X component of the point.
|
| |
| void | X (int _x) |
| | Set the X component of the point.
|
| |
| int | Y () const |
| | Return the Y component of the point.
|
| |
| void | Y (int _y) |
| | Set the Y component of the point.
|
| |
| std::string | ToString () |
| | ToString returns a string in the format (x,y).
|
| |
| void | ToPolar (Polar2D &) |
| | ToPolar converts the Point2D to a polar coordinate in-place.
|
| |
| void | Rotate (Point2D &rotated, double theta) |
| | Rotate rotates the point by theta radians.
|
| |
| std::vector< Point2D > | Rotate (std::vector< Polar2D > vertices, double theta) |
| | Rotate this point around a series of vertices.
|
| |
| void | Translate (const Point2D &other, Point2D &translated) |
| | Translate adds this point to the first argument, storing the result in the second argument.
|
| |
| int | Distance (const Point2D &other) const |
| | Distance returns the distance from this point to another.
|
| |
| | Vector () |
| | Construct a unit vector of a given type and size.
|
| |
| | Vector (std::initializer_list< int > ilst) |
| | Construct a Vector with initial values.
|
| |
| int | At (size_t index) const |
| | Return the element At index i.
|
| |
| void | Set (size_t index, int value) |
| | Set a new value for the vector.
|
| |
| int | Magnitude () const |
| | Compute the length of the vector.
|
| |
| void | SetEpsilon (int eps) |
| | Set equivalence tolerance.
|
| |
| bool | IsZero () const |
| | Determine whether this is a zero vector.
|
| |
| Vector | UnitVector () const |
| | Obtain the unit vector for this vector.
|
| |
| bool | IsUnitVector () const |
| | Determine if this is a unit vector.
|
| |
| int | Angle (const Vector< int, N > &other) const |
| | Compute the Angle between two vectors.
|
| |
| bool | IsParallel (const Vector< int, N > &other) const |
| | Determine whether two vectors are parallel.
|
| |
| bool | IsOrthogonal (const Vector< int, N > &other) const |
| | Determine if two vectors are orthogonal or perpendicular to each other.
|
| |
| Vector | ProjectParallel (const Vector< int, N > &basis) const |
| | Project this vector onto some basis vector.
|
| |
| Vector | ProjectOrthogonal (const Vector< int, N > &basis) |
| | Project this vector perpendicularly onto some basis vector.
|
| |
| Vector | Cross (const Vector< int, N > &other) const |
| | Compute the cross product of two vectors.
|
| |
| Vector | operator+ (const Vector< int, N > &other) const |
| | Vector addition.
|
| |
| Vector | operator- (const Vector< int, N > &other) const |
| | Vector subtraction.
|
| |
| Vector | operator* (const int k) const |
| | Scalar multiplication.
|
| |
| int | operator* (const Vector< int, N > &other) const |
| | Compute the Dot product between two vectors.
|
| |
| Vector | operator/ (const int k) const |
| | Scalar division.
|
| |
| bool | operator== (const Vector< int, N > &other) const |
| | Vector equivalence.
|
| |
| bool | operator!= (const Vector< int, N > &other) const |
| | Vector non-equivalence.
|
| |
| const int & | operator[] (size_t i) const |
| | Array indexing into vector.
|
| |
Point2D is a cartesian (X,Y) pairing.