PCL
pcl::GenericPoint< T > Class Template Reference

A generic point in the two-dimensional space. More...

#include <Point.h>

Public Types

using component = T
 

Public Member Functions

constexpr GenericPoint ()
 
constexpr GenericPoint (component d)
 
template<typename T1 >
 GenericPoint (const GenericPoint< T1 > &p)
 
template<typename T1 >
 GenericPoint (std::initializer_list< T1 > l)
 
template<typename T1 , typename T2 >
constexpr GenericPoint (T1 xPos, T2 yPos)
 
GenericPoint Deg () const noexcept
 
template<typename T1 >
double DistanceTo (const GenericPoint< T1 > &p) const noexcept
 
double DistanceToOrigin () const noexcept
 
template<typename T1 >
double Dot (const GenericPoint< T1 > &p) const noexcept
 
template<typename T1 , typename T2 >
double Dot (T1 px, T2 py) const noexcept
 
template<typename T1 >
double ManhattanDistanceTo (const GenericPoint< T1 > &p) const noexcept
 
double ManhattanDistanceToOrigin () const noexcept
 
template<typename T1 >
void MoveBy (const GenericPoint< T1 > &d) noexcept
 
template<typename T1 , typename T2 >
void MoveBy (T1 dx, T2 dy) noexcept
 
template<typename T1 >
void MoveBy (T1 dxy) noexcept
 
template<typename T1 >
GenericPoint MovedBy (const GenericPoint< T1 > &d) const noexcept
 
template<typename T1 , typename T2 >
GenericPoint MovedBy (T1 dx, T2 dy) const noexcept
 
template<typename T1 >
GenericPoint MovedTo (const GenericPoint< T1 > &p) const noexcept
 
template<typename T1 , typename T2 >
GenericPoint MovedTo (T1 xPos, T2 yPos) const noexcept
 
template<typename T1 >
void MoveTo (const GenericPoint< T1 > &p) noexcept
 
template<typename T1 , typename T2 >
void MoveTo (T1 xPos, T2 yPos) noexcept
 
GenericPointoperator*= (component d) noexcept
 
template<typename T1 >
GenericPointoperator*= (const GenericPoint< T1 > &p) noexcept
 
GenericPoint operator+ () const noexcept
 
GenericPointoperator+= (component d) noexcept
 
template<typename T1 >
GenericPointoperator+= (const GenericPoint< T1 > &p) noexcept
 
GenericPoint operator- () const noexcept
 
GenericPointoperator-= (component d) noexcept
 
template<typename T1 >
GenericPointoperator-= (const GenericPoint< T1 > &p) noexcept
 
GenericPointoperator/= (component d) noexcept
 
template<typename T1 >
GenericPointoperator/= (const GenericPoint< T1 > &p) noexcept
 
GenericPointoperator= (component v) noexcept
 
template<typename T1 >
GenericPointoperator= (const GenericPoint< T1 > &p) noexcept
 
component operator[] (int i) const noexcept
 
componentoperator[] (int i) noexcept
 
void Reflect () noexcept
 
GenericPoint Reflected () const noexcept
 
GenericPoint ReflectedX () const noexcept
 
GenericPoint ReflectedY () const noexcept
 
void ReflectX () noexcept
 
void ReflectY () noexcept
 
template<typename T1 , typename T2 >
void Rotate (T1 angle, const GenericPoint< T2 > &center) noexcept
 
template<typename T1 , typename T2 >
void Rotate (T1 angle, T2 xc, T2 yc) noexcept
 
template<typename T1 , typename T2 >
void Rotate (T1 sa, T1 ca, const GenericPoint< T2 > &center) noexcept
 
template<typename T1 , typename T2 >
void Rotate (T1 sa, T1 ca, T2 xc, T2 yc) noexcept
 
template<typename T1 , typename T2 >
GenericPoint Rotated (T1 angle, const GenericPoint< T2 > &center) const noexcept
 
template<typename T1 , typename T2 >
GenericPoint Rotated (T1 angle, T2 xc, T2 yc) const noexcept
 
template<typename T1 , typename T2 >
GenericPoint Rotated (T1 sa, T1 ca, const GenericPoint< T2 > &center) const noexcept
 
template<typename T1 , typename T2 >
GenericPoint Rotated (T1 sa, T1 ca, T2 xc, T2 yc) const noexcept
 
void Round () noexcept
 
void Round (int n) noexcept
 
GenericPoint Rounded () const noexcept
 
GenericPoint Rounded (int n) const noexcept
 
GenericPoint< int > RoundedToInt () const noexcept
 
template<typename T1 >
double SquaredDistanceTo (const GenericPoint< T1 > &p) const noexcept
 
double SquaredDistanceToOrigin () const noexcept
 
GenericPointToDeg () noexcept
 
GenericPointToRad () noexcept
 
void Truncate () noexcept
 
GenericPoint Truncated () const noexcept
 
GenericPoint< int > TruncatedToInt () const noexcept
 

Public Attributes

component x
 Abscissa (horizontal, or X-axis coordinate).
 
component y
 Ordinate (vertical, or Y-axis coordinate).
 

Detailed Description

template<typename T>
class pcl::GenericPoint< T >

GenericPoint implements a point in the plane, specified by its x and y coordinates. The type T represents scalar point coordinates and can be any real or integer numerical type.

The coordinates of GenericPoint are accessed directly by its x and y data members. Given a GenericPoint instance p, you can use p.x and p.y directly to get or set coordinate values.

See also
2-D Point Types, 2-D Point Operators and Functions, GenericRectangle

Definition at line 99 of file Point.h.

Member Typedef Documentation

◆ component

template<typename T >
using pcl::GenericPoint< T >::component = T

Represents the scalar type of a point component.

Definition at line 106 of file Point.h.

Constructor & Destructor Documentation

◆ GenericPoint() [1/5]

template<typename T >
constexpr pcl::GenericPoint< T >::GenericPoint ( )
inlineconstexpr

Constructs a default GenericPoint instance. Point coordinates are not initialized, so they'll have unpredictable garbage values.

Definition at line 118 of file Point.h.

◆ GenericPoint() [2/5]

template<typename T >
template<typename T1 , typename T2 >
constexpr pcl::GenericPoint< T >::GenericPoint ( T1  xPos,
T2  yPos 
)
inlineconstexpr

Constructs a GenericPoint instance given its coordinates xPos and yPos in the plane.

The types T1 and T2 must be convertible to the component type T.

Definition at line 130 of file Point.h.

◆ GenericPoint() [3/5]

template<typename T >
constexpr pcl::GenericPoint< T >::GenericPoint ( component  d)
inlineconstexpr

Constructs a GenericPoint instance with both point coordinates equal to the specified scalar d.

Definition at line 141 of file Point.h.

◆ GenericPoint() [4/5]

template<typename T >
template<typename T1 >
pcl::GenericPoint< T >::GenericPoint ( std::initializer_list< T1 >  l)
inline

Constructs a GenericPoint instance from coordinates taken from the specified initializer list l.

This constructor will copy 2, 1 or zero point coordinates, depending on the number of values in the initializer list. Coordinates that cannot be initialized from list values will be set to zero. For example, the following code:

Point p1 = {};
Point p2 = { 1 };
Point p3 = { 1, 2 };
32-bit integer point on the plane.

is functionally equivalent to:

Point p1( 0, 0 );
Point p2( 1, 0 );
Point p3( 1, 2 );

The type T1 must be convertible to the component type T.

Definition at line 173 of file Point.h.

◆ GenericPoint() [5/5]

template<typename T >
template<typename T1 >
pcl::GenericPoint< T >::GenericPoint ( const GenericPoint< T1 > &  p)
inline

Nontrivial copy constructor. Constructs a GenericPoint instance as a copy (possibly involving a conversion between different numerical types) of another point p with a different template argument.

The type T1 must be convertible to the component type T.

Definition at line 200 of file Point.h.

Member Function Documentation

◆ Deg()

template<typename T >
GenericPoint pcl::GenericPoint< T >::Deg ( ) const
inlinenoexcept

Returns a point whose coordinates are the coordinates of this point converted to degrees, assuming that this point has coordinates expressed in radians.

Definition at line 963 of file Point.h.

References pcl::Deg().

◆ DistanceTo()

template<typename T >
template<typename T1 >
double pcl::GenericPoint< T >::DistanceTo ( const GenericPoint< T1 > &  p) const
inlinenoexcept

Returns the Euclidian distance between this point and another point p in the plane.

The Euclidian distance between two points p and q is the length of the straight line between both points: Sqrt( (p.x - q.x)^2 + (p.y - q.y)^2 ).

The type T1 must be convertible to double.

See also
SquaredDistanceTo(), ManhattanDistanceTo()

Definition at line 250 of file Point.h.

References pcl::Sqrt().

◆ DistanceToOrigin()

template<typename T >
double pcl::GenericPoint< T >::DistanceToOrigin ( ) const
inlinenoexcept

Returns the Euclidian distance between this point and the origin of coordinates in the plane. In other words, this function returns the length of the two-dimensional vector represented by this point object.

This function is equivalent to:

DistanceTo( GenericPoint<double>( 0 ) )
double DistanceTo(const GenericPoint< T1 > &p) const noexcept
Definition: Point.h:250

but potentially faster, depending mainly on compiler optimizations.

See also
SquaredDistanceToOrigin(), ManhattanDistanceToOrigin()

Definition at line 287 of file Point.h.

References pcl::Sqrt().

◆ Dot() [1/2]

template<typename T >
template<typename T1 >
double pcl::GenericPoint< T >::Dot ( const GenericPoint< T1 > &  p) const
inlinenoexcept

Returns the dot product of this point and another point p.

The type T1 must be convertible to double.

Definition at line 1029 of file Point.h.

◆ Dot() [2/2]

template<typename T >
template<typename T1 , typename T2 >
double pcl::GenericPoint< T >::Dot ( T1  px,
T2  py 
) const
inlinenoexcept

Returns the dot product of this point and another point given by its coordinates px and py.

The types T1 and T2 must be convertible to double.

Definition at line 1018 of file Point.h.

◆ ManhattanDistanceTo()

template<typename T >
template<typename T1 >
double pcl::GenericPoint< T >::ManhattanDistanceTo ( const GenericPoint< T1 > &  p) const
inlinenoexcept

Returns the Manhattan distance between this point and another point p in the plane.

The Manhattan distance between two points p and q is the sum of distances measured along axes at right angles: |p.x - q.x| + |p.y - q.y|.

The type T1 must be convertible to double.

See also
DistanceTo(), ManhattanDistanceToOrigin()

Definition at line 304 of file Point.h.

References pcl::Abs().

◆ ManhattanDistanceToOrigin()

template<typename T >
double pcl::GenericPoint< T >::ManhattanDistanceToOrigin ( ) const
inlinenoexcept

Returns the Manhattan distance between this point and the origin of coordinates in the plane. In other words, this function returns the sum of the absolute values of this point's x and y coordinates.

This function is equivalent to:

ManhattanDistanceTo( GenericPoint<double>( 0 ) )
double ManhattanDistanceTo(const GenericPoint< T1 > &p) const noexcept
Definition: Point.h:304

but potentially faster, depending mainly on compiler optimizations.

See also
ManhattanDistanceTo(), DistanceToOrigin()

Definition at line 322 of file Point.h.

References pcl::Abs().

◆ MoveBy() [1/3]

template<typename T >
template<typename T1 >
void pcl::GenericPoint< T >::MoveBy ( const GenericPoint< T1 > &  d)
inlinenoexcept

Moves this point by equal increments in the X and Y directions, relative to its current position.

Parameters
dIncrements in the X and Y directions, given by d.x and d.y, respectively.

The type T1 must be convertible to the component type T.

See also
MoveTo()

Definition at line 396 of file Point.h.

◆ MoveBy() [2/3]

template<typename T >
template<typename T1 , typename T2 >
void pcl::GenericPoint< T >::MoveBy ( T1  dx,
T2  dy 
)
inlinenoexcept

Moves this point by increments dx and dy in the X and Y directions, respectively, relative to its current position.

For example, given the declaration:

GenericPoint<float> p;

These two expressions are equivalent:

p.MoveBy( -3, 7 );
p.MoveTo( p.x-3, p.y+7 );

The types T1 and T2 must be convertible to the component type T.

See also
MoveTo()

Definition at line 421 of file Point.h.

◆ MoveBy() [3/3]

template<typename T >
template<typename T1 >
void pcl::GenericPoint< T >::MoveBy ( T1  dxy)
inlinenoexcept

Moves this point by the same increment dxy in the X and Y directions, relative to its current position.

This function is functionally equivalent to:

MoveBy( dxy, dxy );
void MoveBy(const GenericPoint< T1 > &d) noexcept
Definition: Point.h:396
See also
MoveTo()

Definition at line 437 of file Point.h.

◆ MovedBy() [1/2]

template<typename T >
template<typename T1 >
GenericPoint pcl::GenericPoint< T >::MovedBy ( const GenericPoint< T1 > &  d) const
inlinenoexcept

Returns a point whose coordinates are the coordinates of this point displaced by the increments specified as the point d.

The type T1 must be convertible to the component type T.

Definition at line 456 of file Point.h.

◆ MovedBy() [2/2]

template<typename T >
template<typename T1 , typename T2 >
GenericPoint pcl::GenericPoint< T >::MovedBy ( T1  dx,
T2  dy 
) const
inlinenoexcept

Returns a point whose coordinates are the coordinates of this point displaced by the specified increments dx and dy.

The types T1 and T2 must be convertible to the component type T.

Definition at line 468 of file Point.h.

◆ MovedTo() [1/2]

template<typename T >
template<typename T1 >
GenericPoint pcl::GenericPoint< T >::MovedTo ( const GenericPoint< T1 > &  p) const
inlinenoexcept

Returns a point whose coordinates are equal to the coordinates of the specified point d.

The type T1 must be convertible to the component type T.

Definition at line 368 of file Point.h.

◆ MovedTo() [2/2]

template<typename T >
template<typename T1 , typename T2 >
GenericPoint pcl::GenericPoint< T >::MovedTo ( T1  xPos,
T2  yPos 
) const
inlinenoexcept

Returns a point at the specified xPos and yPos coordinates.

The types T1 and T2 must be convertible to the component type T.

Definition at line 379 of file Point.h.

◆ MoveTo() [1/2]

template<typename T >
template<typename T1 >
void pcl::GenericPoint< T >::MoveTo ( const GenericPoint< T1 > &  p)
inlinenoexcept

Moves this point to the location of another point p.

The type T1 must be convertible to the component type T.

See also
MoveBy()

Definition at line 335 of file Point.h.

◆ MoveTo() [2/2]

template<typename T >
template<typename T1 , typename T2 >
void pcl::GenericPoint< T >::MoveTo ( T1  xPos,
T2  yPos 
)
inlinenoexcept

Moves this point to the specified absolute coordinates xPos and yPos in the plane.

The types T1 and T2 must be convertible to the component type T.

See also
MoveBy()

Definition at line 349 of file Point.h.

◆ operator*=() [1/2]

template<typename T >
GenericPoint& pcl::GenericPoint< T >::operator*= ( component  d)
inlinenoexcept

Multiplies both coordinates of this point by a scalar d. Returns a reference to this point.

See also
operator /=(), operator +=()

Definition at line 816 of file Point.h.

◆ operator*=() [2/2]

template<typename T >
template<typename T1 >
GenericPoint& pcl::GenericPoint< T >::operator*= ( const GenericPoint< T1 > &  p)
inlinenoexcept

Multiplies each coordinate of this point by its homonym coordinate of a given point p. Returns a reference to this point.

The type T1 must be convertible to the component type T.

See also
operator /=(), operator +=()

Definition at line 803 of file Point.h.

◆ operator+()

template<typename T >
GenericPoint pcl::GenericPoint< T >::operator+ ( ) const
inlinenoexcept

Returns a copy of this point.

Definition at line 876 of file Point.h.

◆ operator+=() [1/2]

template<typename T >
GenericPoint& pcl::GenericPoint< T >::operator+= ( component  d)
inlinenoexcept

Adds a scalar d to both coordinates of this point. Returns a reference to this point.

See also
MoveBy(), operator -=()

Definition at line 740 of file Point.h.

◆ operator+=() [2/2]

template<typename T >
template<typename T1 >
GenericPoint& pcl::GenericPoint< T >::operator+= ( const GenericPoint< T1 > &  p)
inlinenoexcept

Adds each coordinate of a given point p to its homonym coordinate in this point. Returns a reference to this point.

The type T1 must be convertible to the component type T.

See also
MoveBy(), operator -=()

Definition at line 727 of file Point.h.

◆ operator-()

template<typename T >
GenericPoint pcl::GenericPoint< T >::operator- ( ) const
inlinenoexcept

Returns a point whose coordinates have the same magnitudes as the coordinates of this point, but opposite signs. The returned point so defined represents a vector diametrically opposed to this one.

Definition at line 886 of file Point.h.

◆ operator-=() [1/2]

template<typename T >
GenericPoint& pcl::GenericPoint< T >::operator-= ( component  d)
inlinenoexcept

Subtracts a scalar d from both coordinates of this point. Returns a reference to this point.

See also
MoveBy(), operator +=()

Definition at line 778 of file Point.h.

◆ operator-=() [2/2]

template<typename T >
template<typename T1 >
GenericPoint& pcl::GenericPoint< T >::operator-= ( const GenericPoint< T1 > &  p)
inlinenoexcept

Subtracts each coordinate of a given point p from its homonym coordinate in this point. Returns a reference to this point.

The type T1 must be convertible to the component type T.

See also
MoveBy(), operator +=()

Definition at line 765 of file Point.h.

◆ operator/=() [1/2]

template<typename T >
GenericPoint& pcl::GenericPoint< T >::operator/= ( component  d)
inlinenoexcept

Divides both coordinates of this point by a scalar d. Returns a reference to this point.

See also
operator *=(), operator -=()

Definition at line 855 of file Point.h.

◆ operator/=() [2/2]

template<typename T >
template<typename T1 >
GenericPoint& pcl::GenericPoint< T >::operator/= ( const GenericPoint< T1 > &  p)
inlinenoexcept

Divides each coordinate of this point by its homonym coordinate of a given point p. Returns a reference to this point.

The type T1 must be convertible to the component type T.

See also
operator *=(), operator -=()

Definition at line 841 of file Point.h.

◆ operator=() [1/2]

template<typename T >
GenericPoint& pcl::GenericPoint< T >::operator= ( component  v)
inlinenoexcept

Assignment operator. Given a coordinate v, moves this point to a location x = y = v. Returns a reference to this point.

See also
MoveTo()

Definition at line 703 of file Point.h.

◆ operator=() [2/2]

template<typename T >
template<typename T1 >
GenericPoint& pcl::GenericPoint< T >::operator= ( const GenericPoint< T1 > &  p)
inlinenoexcept

Nontrivial assignment operator. Moves this point to the location specified as a point p. Returns a reference to this point.

The type T1 must be convertible to the component type T.

See also
MoveTo()

Definition at line 690 of file Point.h.

◆ operator[]() [1/2]

template<typename T >
component pcl::GenericPoint< T >::operator[] ( int  i) const
inlinenoexcept

Returns a copy of a point component. Returns the X point coordinate if the specified index i is zero, or the Y coordinate otherwise.

Definition at line 1006 of file Point.h.

◆ operator[]() [2/2]

template<typename T >
component& pcl::GenericPoint< T >::operator[] ( int  i)
inlinenoexcept

Returns a reference to a point component. Returns a reference to the X point coordinate if the specified index i is zero, or a reference to the Y coordinate otherwise.

Definition at line 997 of file Point.h.

◆ Reflect()

template<typename T >
void pcl::GenericPoint< T >::Reflect ( )
inlinenoexcept

Reflects this point in the origin. This transformation changes the signs of both point coordinates.

Definition at line 895 of file Point.h.

◆ Reflected()

template<typename T >
GenericPoint pcl::GenericPoint< T >::Reflected ( ) const
inlinenoexcept

Returns the reflexion of this point in the origin. The returned point has the coordinates of this point with inverse signs.

Definition at line 923 of file Point.h.

◆ ReflectedX()

template<typename T >
GenericPoint pcl::GenericPoint< T >::ReflectedX ( ) const
inlinenoexcept

Returns the reflexion of this point across the X axis. The returned point has the same x-coordinate as this point and the y-coordinate of this point with inverse sign.

Definition at line 933 of file Point.h.

◆ ReflectedY()

template<typename T >
GenericPoint pcl::GenericPoint< T >::ReflectedY ( ) const
inlinenoexcept

Returns the reflexion of this point across the Y axis. The returned point has the x-coordinate of this point with inverse sign and the same y-coordinate as this point.

Definition at line 943 of file Point.h.

◆ ReflectX()

template<typename T >
void pcl::GenericPoint< T >::ReflectX ( )
inlinenoexcept

Reflects this point across the X axis. This transformation changes the sign of this point's y-coordinate.

Definition at line 905 of file Point.h.

◆ ReflectY()

template<typename T >
void pcl::GenericPoint< T >::ReflectY ( )
inlinenoexcept

Reflects this point across the Y axis. This transformation changes the sign of this point's x-coordinate.

Definition at line 914 of file Point.h.

◆ Rotate() [1/4]

template<typename T >
template<typename T1 , typename T2 >
void pcl::GenericPoint< T >::Rotate ( T1  angle,
const GenericPoint< T2 > &  center 
)
inlinenoexcept

Rotates this point in the plane by the specified angle in radians, with respect to the specified center of rotation.

The types T1 and T2 must be convertible to double.

Definition at line 493 of file Point.h.

References pcl::Rotate().

◆ Rotate() [2/4]

template<typename T >
template<typename T1 , typename T2 >
void pcl::GenericPoint< T >::Rotate ( T1  angle,
T2  xc,
T2  yc 
)
inlinenoexcept

Rotates this point in the plane by the specified angle in radians, with respect to a center of rotation given by its coordinates xc and yc.

The types T1 and T2 must be convertible to double.

Definition at line 481 of file Point.h.

References pcl::Rotate().

Referenced by pcl::GenericPoint< T >::Rotated().

◆ Rotate() [3/4]

template<typename T >
template<typename T1 , typename T2 >
void pcl::GenericPoint< T >::Rotate ( T1  sa,
T1  ca,
const GenericPoint< T2 > &  center 
)
inlinenoexcept

Rotates this point in the plane by the specified angle, given by its sine and cosine, sa and ca respectively, with respect to the specified center of rotation.

The types T1 and T2 must be convertible to double.

Definition at line 519 of file Point.h.

References pcl::Rotate().

◆ Rotate() [4/4]

template<typename T >
template<typename T1 , typename T2 >
void pcl::GenericPoint< T >::Rotate ( T1  sa,
T1  ca,
T2  xc,
T2  yc 
)
inlinenoexcept

Rotates this point in the plane by the specified angle, given by its sine and cosine, sa and ca respectively, with respect to a center of rotation given by its coordinates xc and yc.

The types T1 and T2 must be convertible to double.

Definition at line 506 of file Point.h.

References pcl::Rotate().

◆ Rotated() [1/4]

template<typename T >
template<typename T1 , typename T2 >
GenericPoint pcl::GenericPoint< T >::Rotated ( T1  angle,
const GenericPoint< T2 > &  center 
) const
inlinenoexcept

Returns a point whose coordinates are the coordinates of this point rotated in the plane by the specified angle in radians, with respect to the specified center of rotation.

The types T1 and T2 must be convertible to double.

Definition at line 547 of file Point.h.

References pcl::GenericPoint< T >::Rotate().

◆ Rotated() [2/4]

template<typename T >
template<typename T1 , typename T2 >
GenericPoint pcl::GenericPoint< T >::Rotated ( T1  angle,
T2  xc,
T2  yc 
) const
inlinenoexcept

Returns a point whose coordinates are the coordinates of this point rotated in the plane by the specified angle in radians, with respect to a center of rotation given by its coordinates xc and yc.

The types T1 and T2 must be convertible to double.

Definition at line 532 of file Point.h.

References pcl::GenericPoint< T >::Rotate().

◆ Rotated() [3/4]

template<typename T >
template<typename T1 , typename T2 >
GenericPoint pcl::GenericPoint< T >::Rotated ( T1  sa,
T1  ca,
const GenericPoint< T2 > &  center 
) const
inlinenoexcept

Returns a point whose coordinates are the coordinates of this point rotated in the plane by the specified angle given by its sine and cosine, sa and ca respectively, with respect to the specified center of rotation.

The types T1 and T2 must be convertible to double.

Definition at line 579 of file Point.h.

References pcl::GenericPoint< T >::Rotate().

◆ Rotated() [4/4]

template<typename T >
template<typename T1 , typename T2 >
GenericPoint pcl::GenericPoint< T >::Rotated ( T1  sa,
T1  ca,
T2  xc,
T2  yc 
) const
inlinenoexcept

Returns a point whose coordinates are the coordinates of this point rotated in the plane by the specified angle given by its sine and cosine, sa and ca respectively, with respect to a center of rotation given by its coordinates xc and yc.

The types T1 and T2 must be convertible to double.

Definition at line 563 of file Point.h.

References pcl::GenericPoint< T >::Rotate().

◆ Round() [1/2]

template<typename T >
void pcl::GenericPoint< T >::Round ( )
inlinenoexcept

Rounds the coordinates of this point to their corresponding nearest integer coordinates.

See also
Round( int ), Rounded(), Truncate(), RoundedToInt(), TruncatedToInt()

Definition at line 592 of file Point.h.

References pcl::Round().

◆ Round() [2/2]

template<typename T >
void pcl::GenericPoint< T >::Round ( int  n)
inlinenoexcept

Rounds the coordinates of this point to n fractional digits (n >= 0).

See also
Round(), Rounded( int ), Truncate(), RoundedToInt(), TruncatedToInt()

Definition at line 603 of file Point.h.

References pcl::Round().

◆ Rounded() [1/2]

template<typename T >
GenericPoint pcl::GenericPoint< T >::Rounded ( ) const
inlinenoexcept

Returns a point whose coordinates are the coordinates of this point rounded to their nearest integers.

See also
Round(), Rounded( int ), Truncated(), RoundedToInt(), TruncatedToInt()

Definition at line 616 of file Point.h.

References pcl::Round().

◆ Rounded() [2/2]

template<typename T >
GenericPoint pcl::GenericPoint< T >::Rounded ( int  n) const
inlinenoexcept

Returns a point whose coordinates are the coordinates of this point rounded to n fractional digits (n >= 0).

See also
Round( int ), Rounded(), Truncated(), RoundedToInt(), TruncatedToInt()

Definition at line 627 of file Point.h.

References pcl::Round().

◆ RoundedToInt()

template<typename T >
GenericPoint<int> pcl::GenericPoint< T >::RoundedToInt ( ) const
inlinenoexcept

Returns a point of integer template type whose coordinates are the coordinates of this point rounded to their nearest integers.

See also
Round(), Rounded(), Truncated(), TruncatedToInt()

Definition at line 639 of file Point.h.

References pcl::RoundInt().

◆ SquaredDistanceTo()

template<typename T >
template<typename T1 >
double pcl::GenericPoint< T >::SquaredDistanceTo ( const GenericPoint< T1 > &  p) const
inlinenoexcept

Returns the square of the Euclidian distance between this point and another point p in the plane.

The Euclidian distance between two points p and q is the length of the straight line between both points: Sqrt( (p.x - q.x)^2 + (p.y - q.y)^2 ).

This function returns just the radicand (p.x - q.x)^2 + (p.y - q.y)^2. This is useful because saves calculation of a square root, which is unnecessary in some practical cases. One of them is ordering of distances: Sqrt(A) < Sqrt(B) implies A < B.

The type T1 must be convertible to double.

See also
DistanceTo(), ManhattanDistanceTo()

Definition at line 231 of file Point.h.

◆ SquaredDistanceToOrigin()

template<typename T >
double pcl::GenericPoint< T >::SquaredDistanceToOrigin ( ) const
inlinenoexcept

Returns the square of the Euclidian distance between this point and the origin of coordinates in the plane. In other words, this function returns the squared length of the two-dimensional vector represented by this point object.

This function is equivalent to:

SquaredDistanceTo( GenericPoint<double>( 0 ) )
double SquaredDistanceTo(const GenericPoint< T1 > &p) const noexcept
Definition: Point.h:231

but potentially faster, depending mainly on compiler optimizations.

See also
DistanceToOrigin()

Definition at line 269 of file Point.h.

◆ ToDeg()

template<typename T >
GenericPoint& pcl::GenericPoint< T >::ToDeg ( )
inlinenoexcept

Converts the coordinates of this point to degrees, assuming that they are expressed in radians before calling this function. Returns a reference to this object.

Definition at line 985 of file Point.h.

References pcl::Deg().

◆ ToRad()

template<typename T >
GenericPoint& pcl::GenericPoint< T >::ToRad ( )
inlinenoexcept

Converts the coordinates of this point to radians, assuming that they are expressed in degrees before calling this function. Returns a reference to this object.

Definition at line 973 of file Point.h.

References pcl::Rad().

◆ Truncate()

template<typename T >
void pcl::GenericPoint< T >::Truncate ( )
inlinenoexcept

Integer truncation of coordinates. Sets the coordinates x, y of this point to the corresponding nearest integer coordinates i, j, such that i <= x and j <= y.

See also
Truncated(), Round(), RoundedToInt(), TruncatedToInt()

Definition at line 651 of file Point.h.

References pcl::Trunc().

◆ Truncated()

template<typename T >
GenericPoint pcl::GenericPoint< T >::Truncated ( ) const
inlinenoexcept

Integer truncation of coordinates. Returns a point whose coordinates are the coordinates x, y of this point truncated to their corresponding nearest integer coordinates i, j, such that i <= x and j <= y.

See also
Truncate(), Rounded(), RoundedToInt(), TruncatedToInt()

Definition at line 664 of file Point.h.

References pcl::Trunc().

◆ TruncatedToInt()

template<typename T >
GenericPoint<int> pcl::GenericPoint< T >::TruncatedToInt ( ) const
inlinenoexcept

Integer truncation of coordinates. Returns a point of integer template type whose coordinates are the coordinates x, y of this point truncated to the nearest integer coordinates i, j, such that i <= x and j <= y.

See also
Truncate(), Truncated(), Rounded(), RoundedToInt()

Definition at line 676 of file Point.h.

References pcl::TruncInt().


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