#include <rect.h>
Public Member Functions | |
constexpr | Point (int16 x1, int16 y1) |
bool | operator== (const Point &p) const |
bool | operator!= (const Point &p) const |
Point | operator+ (const Point &delta) const |
Point | operator- (const Point &delta) const |
Point | operator/ (int divisor) const |
Point | operator* (int multiplier) const |
Point | operator/ (double divisor) const |
Point | operator* (double multiplier) const |
void | operator+= (const Point &delta) |
void | operator-= (const Point &delta) |
uint | sqrDist (const Point &p) const |
Public Attributes | |
int16 | x |
int16 | y |
Simple class for handling both 2D position and size.
|
inline |
Create a point with position defined by x1
and y1
.
|
inline |
Determine whether the position of two points is the same.
|
inline |
Determine whether the position of two points is not the same.
Create a point by adding the delta
value to a point.
Create a point by subtracting the delta
value from a point.
|
inline |
Create a point by dividing a point by the (int) divisor
value.
|
inline |
Create a point by multiplying a point by the (int) multiplier
value.
|
inline |
Create a point by dividing a point by the (double) divisor
value.
|
inline |
Create a point by multiplying a point by the (double) multiplier
value.
|
inline |
Change a point's position by adding delta
to its x and y coordinates.
|
inline |
Change a point's position by subtracting delta
from its x and y arguments.
|
inline |
Return the square of the distance between this point and the point p
.
p | The other point. |
p
. int16 Common::Point::x |
The horizontal position of the point.
int16 Common::Point::y |
The vertical position of the point.