CartoType C++ API 8.8-7-gb35e4dc71
for Windows, Linux, Qt and other platforms supporting C++ development
|
#include <cartotype_base.h>
Public Member Functions | |
constexpr | Point2 () noexcept |
constexpr | Point2 (T aX, T aY) noexcept |
constexpr | Point2 (const Point &aPoint) noexcept |
bool | operator== (const Point2< T > &aPoint) const noexcept |
bool | operator!= (const Point2< T > &aPoint) const noexcept |
void | operator+= (const Point2< T > &aPoint) noexcept |
void | operator-= (const Point2< T > &aPoint) noexcept |
void | operator*= (T aFactor) noexcept |
bool | operator< (const Point2< T > &aPoint) const noexcept |
bool | operator> (const Point2< T > &aPoint) const noexcept |
T | VectorLength () const noexcept |
T | DistanceFrom (const Point2< T > &aOther) const noexcept |
T | CrossProduct (const Point2< T > &aOther) const noexcept |
Point2 | UnitVector () const noexcept |
Point2 | LeftUnitVector () const noexcept |
Point2 | RightUnitVector () const noexcept |
bool | LeftOfVector (const Point2< T > &aPoint) const noexcept |
bool | RightOfVector (const Point2< T > &aPoint) const noexcept |
Point | Rounded () const noexcept |
Point | Rounded64ths () const noexcept |
void | Rotate (double aAngle) |
Public Attributes | |
T | X { 0 } |
T | Y { 0 } |
A templated 2D point or vector class. In the vector functions, left and right are defined using x increasing right and y increasing up.
|
inlineconstexprnoexcept |
Create a point with coordinates (0,0).
|
inlineconstexprnoexcept |
Create a point, specifying coordinates.
|
inlineconstexprnoexcept |
Create a point from a Point object.
|
inlinenoexcept |
Returns the cross product of two vectors. The cross product of two unit vectors is the sine of the angle swept out by going from this vector to the other vector in an anticlockwise direction, and may be positive or negative.
|
inlinenoexcept |
Returns the distance of this point from another point.
|
inlinenoexcept |
Returns true if aPoint is left of this vector.
|
inlinenoexcept |
Returns a unit vector pointing 90 degrees left of this vector.
|
inlinenoexcept |
The inequality operator.
|
inlinenoexcept |
Scale a point by a factor.
|
inlinenoexcept |
Offset a point by another point, treated as a positive vector.
|
inlinenoexcept |
Offset a point by another point, treated as a negative vector.
|
inlinenoexcept |
The less-than operator, ordering points by x coordinate, then y coordinate.
|
inlinenoexcept |
The equality operator.
|
inlinenoexcept |
The greater-than operator, ordering points by x coordinate, then y coordinate.
|
inlinenoexcept |
Returns true if aPoint is right of this vector.
|
inlinenoexcept |
Returns a unit vector pointing 90 degrees right of this vector.
|
inline |
Rotates the point about the origin by an angle given in radians.
|
inlinenoexcept |
Returns an integer point by rounding the coordinates to the nearest integer. Coordinates with a fractional part of 0.5 are rounded away from zero.
|
inlinenoexcept |
Returns an integer point in rounded 64ths of the values in this point.
|
inlinenoexcept |
Returns a unit vector pointing in the same direction as this point treated as a vector.
|
inlinenoexcept |
Returns the length of the vector represented by this point: its distance from the origin (0,0).
T CartoTypeCore::Point2< T >::X { 0 } |
The x coordinate.
T CartoTypeCore::Point2< T >::Y { 0 } |
The y coordinate.