Defines a point with integer coordinates on a plane. More...
#include <geometry_utils.h>
Public Member Functions | |
DiscretePoint2D (int x_coord, int y_coord) | |
double | dist_sq (const DiscretePoint2D &pt) const |
DiscretePoint2D | operator+ (const DiscretePoint2D &p) const |
Operator of points summation by element-wise addition. | |
DiscretePoint2D | operator- () const |
Returns additive inverse of the point. | |
Public Attributes | |
y | |
Coordinates of point. |
Defines a point with integer coordinates on a plane.
Definition at line 62 of file geometry_utils.h.
DiscretePoint2D::DiscretePoint2D | ( | int | x_coord, |
int | y_coord | ||
) | [inline] |
Initializes a point in cartesian coordinates.
x_coord,y_coord | Coordinates of a point on a plane. |
Definition at line 69 of file geometry_utils.h.
double DiscretePoint2D::dist_sq | ( | const DiscretePoint2D & | pt | ) | const [inline] |
Calculates distance from this point to a given one.
pt | The end point to calculate distance. |
Definition at line 89 of file geometry_utils.h.
DiscretePoint2D DiscretePoint2D::operator+ | ( | const DiscretePoint2D & | p | ) | const [inline] |
Operator of points summation by element-wise addition.
Definition at line 75 of file geometry_utils.h.
DiscretePoint2D DiscretePoint2D::operator- | ( | ) | const [inline] |
Returns additive inverse of the point.
Definition at line 80 of file geometry_utils.h.
Coordinates of point.
Definition at line 70 of file geometry_utils.h.