Public Member Functions | Public Attributes | List of all members
DiscretePoint2D Struct Reference

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...
 

Detailed Description

Defines a point with integer coordinates on a plane.

Definition at line 62 of file geometry_utils.h.

Constructor & Destructor Documentation

DiscretePoint2D::DiscretePoint2D ( int  x_coord,
int  y_coord 
)
inline

Initializes a point in cartesian coordinates.

Parameters
x_coord,y_coordCoordinates of a point on a plane.

Definition at line 69 of file geometry_utils.h.

Member Function Documentation

double DiscretePoint2D::dist_sq ( const DiscretePoint2D pt) const
inline

Calculates distance from this point to a given one.

Parameters
ptThe end point to calculate distance.
Returns
The distance between this point and the end point.

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.

Member Data Documentation

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.


The documentation for this struct was generated from the following file:


tiny_slam
Author(s):
autogenerated on Mon Jun 10 2019 15:30:57