iLab Neuromorphic Robotics Toolkit  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nrt::Point2D< T > Class Template Reference

#include <nrt/Core/Geometry/Point.H>

template<class T>
class nrt::Point2D< T >

A 2-Dimensional Point Class.

See Also
Point
Examples:
tests/test-Geometry.C, and tests/test-Point.C.

Definition at line 152 of file Point.H.

Inheritance diagram for nrt::Point2D< T >:
nrt::Point< T, 2 >

Public Member Functions

 Point2D ()
 Construct an uninitialized Point.
 
 Point2D (T x, T y)
 Construct a Point by specifying the x,y dimensions.
 
 Point2D (std::array< T, 2 > const &init)
 Construct a Point from an std::array.
 
 Point2D (Point< T, 2 > const &other)
 Copy constructor.
 
 Point2D (Point< T, 2 > &&other)
 Move constructor.
 
template<class U >
 Point2D (Point< U, 2 > const &other)
 Conversion copy constructor, uses nrt::clamped_convert<T,U> internally.
 
T & x ()
 Access the first dimension of this Point.
 
T const & x () const
 Access the first dimension of this Point - const version.
 
T & y ()
 Access the second dimension of this Point.
 
T const & y () const
 Access the second dimension of this Point - const version.
 
- Public Member Functions inherited from nrt::Point< T, 2 >
 Point ()
 Construct an uninitialized point.
 
 Point (S...args)
 Construct a Point by specifying the value of each Dimension. More...
 
 Point (std::array< T, Dimensions > const &init)
 Construct a point from an std::array.
 
 Point (Point< T, Dimensions > const &other)=default
 Copy constructor.
 
 Point (Point< T, Dimensions > &&other)=default
 Move constructor.
 
 Point (Point< U, Dimensions > const &other)
 Conversion copy constructor, uses nrt::clamped_convert<T,U> internally.
 
Point< T, Dimensions > & operator= (Point< T, Dimensions > const &other)=default
 Assignment.
 
Point< T, Dimensions > & operator= (Point< T, Dimensions > &&other)=default
 Move assignment.
 
T & operator[] (size_t index)
 Access a single dimension of the Point.
 
T const & operator[] (size_t index) const
 Access a single dimension of the Point - const version.
 
double distanceTo (Point< U, Dimensions > const &other) const
 Compute the Euclidian distance to another point.
 
double squaredDistanceTo (Point< U, Dimensions > const &other) const
 Compute the squared Euclidian distance to another point.
 
double magnitude () const
 Compute the magnitude (the Euclidian distance from the origin)
 
double manhattanDistanceTo (Point< U, Dimensions > const &other) const
 Compute the Manhattan distance to another point.
 
T * begin ()
 Access the beginning of the underlying array.
 
T const * begin () const
 Access the beginning of the underlying array - const version.
 
T * end ()
 Access the end of the underlying array.
 
T const * end () const
 Access the end of the underlying array - const version.
 

Related Functions

(Note that these are not member functions.)

template<class T >
Point2D< T > rotate (Point2D< T > const &src, double const angle)
 Return a rotated version of the source object, about its center by a given angle in radians. More...
 
template<class T >
Point2D< T > rotateAbout (Point2D< T > const &src, Point2D< T > const &p, double const angle)
 Return a rotated version of the source object, about the given point and by a given angle in radians. More...
 

Additional Inherited Members

- Protected Member Functions inherited from nrt::Point< T, 2 >
void serialize (Archive &ar)
 Serialization.
 
- Protected Attributes inherited from nrt::Point< T, 2 >
std::array< T, Dimensions > itsData
 

Friends And Related Function Documentation

template<class T >
Point2D< T > rotate ( Point2D< T > const &  src,
double const  angle 
)
related

Return a rotated version of the source object, about its center by a given angle in radians.

template<class T >
Point2D< T > rotateAbout ( Point2D< T > const &  src,
Point2D< T > const &  p,
double const  angle 
)
related

Return a rotated version of the source object, about the given point and by a given angle in radians.


The documentation for this class was generated from the following files: