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. More... | |
DiscretePoint2D | operator- () const |
Returns additive inverse of the point. More... | |
Public Attributes | |
int | x |
int | y |
Coordinates of point. More... | |
Defines a point with integer coordinates on a plane.
Definition at line 62 of file geometry_utils.h.
|
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.
|
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.
|
inline |
Operator of points summation by element-wise addition.
Definition at line 75 of file geometry_utils.h.
|
inline |
Returns additive inverse of the point.
Definition at line 80 of file geometry_utils.h.
int DiscretePoint2D::x |
Definition at line 72 of file geometry_utils.h.
int DiscretePoint2D::y |
Coordinates of point.
Definition at line 72 of file geometry_utils.h.