Rhino C++ API  8.14
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ON_2dPoint Class Reference

#include <opennurbs_point.h>

Public Member Functions

 ON_2dPoint ()=default
 x,y not initialized More...
 
 ON_2dPoint (const class ON_2fPoint &)
 from 2f point More...
 
 ON_2dPoint (const class ON_2fVector &)
 from 2f vector More...
 
 ON_2dPoint (const class ON_3fPoint &)
 from 3f point More...
 
 ON_2dPoint (const class ON_3fVector &)
 from 3f vector More...
 
 ON_2dPoint (const class ON_4fPoint &h)
 from 4f point - h.w must be non-zero More...
 
 ON_2dPoint (const double *)
 from double[2] array More...
 
 ON_2dPoint (const float *)
 from float[2] array More...
 
 ON_2dPoint (const ON_2dPoint &)=default
 
 ON_2dPoint (const ON_2dVector &)
 from 2d vector More...
 
 ON_2dPoint (const ON_3dPoint &)
 from 3d point More...
 
 ON_2dPoint (const ON_3dVector &)
 from 3d vector More...
 
 ON_2dPoint (const ON_4dPoint &h)
 from 4d point - h.w must be non-zero More...
 
 ON_2dPoint (double x, double y)
 
 ~ON_2dPoint ()=default
 
ON__UINT32 DataCRC (ON__UINT32 current_remainder) const
 
double DistanceTo (const ON_2dPoint &) const
 
double DistanceToSquared (const ON_2dPoint &) const
 
bool IsCoincident (const ON_2dPoint &P) const
 
bool IsNan () const
 
bool IsNotZero () const
 
bool IsUnset () const
 
bool IsUnsetOrNan () const
 
bool IsValid () const
 
bool IsZero () const
 
double MaximumCoordinate () const
 absolute value of maximum coordinate More...
 
int MaximumCoordinateIndex () const
 
double MinimumCoordinate () const
 absolute value of minimum coordinate More...
 
int MinimumCoordinateIndex () const
 
 operator const double * () const
 
 operator double * ()
 (double*) conversion operators More...
 
bool operator!= (const ON_2dPoint &) const
 
double operator* (const ON_2dPoint &) const
 dot product for points acting as vectors More...
 
double operator* (const ON_2dVector &) const
 dot product for points acting as vectors More...
 
ON_2dPoint operator* (const ON_Xform &) const
 
ON_2dPoint operator* (double) const
 
ON_2dPoint operator* (float) const
 
ON_2dPoint operator* (int) const
 
ON_2dPointoperator*= (double)
 
ON_2dPoint operator+ (const ON_2dPoint &) const
 
ON_2dPoint operator+ (const ON_2dVector &) const
 
ON_2dPoint operator+ (const ON_2fPoint &) const
 
ON_2dPoint operator+ (const ON_2fVector &) const
 
ON_3dPoint operator+ (const ON_3dPoint &) const
 
ON_3dPoint operator+ (const ON_3dVector &) const
 
ON_3dPoint operator+ (const ON_3fPoint &) const
 
ON_3dPoint operator+ (const ON_3fVector &) const
 
ON_2dPointoperator+= (const ON_2dVector &)
 
ON_2dVector operator- (const ON_2dPoint &) const
 
ON_2dPoint operator- (const ON_2dVector &) const
 
ON_2dVector operator- (const ON_2fPoint &) const
 
ON_2dPoint operator- (const ON_2fVector &) const
 
ON_3dVector operator- (const ON_3dPoint &) const
 
ON_3dPoint operator- (const ON_3dVector &) const
 
ON_3dVector operator- (const ON_3fPoint &) const
 
ON_3dPoint operator- (const ON_3fVector &) const
 
ON_2dPointoperator-= (const ON_2dVector &)
 
ON_2dPoint operator/ (double) const
 
ON_2dPoint operator/ (float) const
 
ON_2dPoint operator/ (int) const
 
ON_2dPointoperator/= (double)
 
bool operator< (const ON_2dPoint &) const
 
bool operator<= (const ON_2dPoint &) const
 dictionary order comparisons More...
 
ON_2dPointoperator= (const double *)
 point = double[2] support More...
 
ON_2dPointoperator= (const float *)
 point = float[2] support More...
 
ON_2dPointoperator= (const ON_2dPoint &)=default
 
ON_2dPointoperator= (const ON_2dVector &)
 
ON_2dPointoperator= (const ON_2fPoint &)
 
ON_2dPointoperator= (const ON_2fVector &)
 
ON_2dPointoperator= (const ON_3dPoint &)
 use implicit operator=(const ON_2dPoint&) More...
 
ON_2dPointoperator= (const ON_3dVector &)
 
ON_2dPointoperator= (const ON_3fPoint &)
 
ON_2dPointoperator= (const ON_3fVector &)
 
ON_2dPointoperator= (const ON_4dPoint &)
 
ON_2dPointoperator= (const ON_4fPoint &)
 
bool operator== (const ON_2dPoint &) const
 
bool operator> (const ON_2dPoint &) const
 
bool operator>= (const ON_2dPoint &) const
 
double & operator[] (int)
 index operators mimic double[2] behavior More...
 
double operator[] (int) const
 
double & operator[] (unsigned int)
 
double operator[] (unsigned int) const
 
void Rotate (double angle, const ON_2dPoint &center)
 
void Rotate (double sin_angle, double cos_angle, const ON_2dPoint &center)
 
void Set (double x, double y)
 set 2d point value More...
 
void Transform (const ON_Xform &)
 
void Zero ()
 set all coordinates to zero; More...
 

Static Public Member Functions

static int Compare (const ON_2dPoint &lhs, const ON_2dPoint &rhs)
 
static const ON_2dPoint Midpoint (const ON_2dPoint &A, const ON_2dPoint &B)
 

Public Attributes

double x
 
double y
 

Static Public Attributes

static const ON_2dPoint NanPoint
 (ON_DBL_QNAN,ON_DBL_QNAN) More...
 
static const ON_2dPoint Origin
 (0.0,0.0) More...
 
static const ON_2dPoint UnsetPoint
 (ON_UNSET_VALUE,ON_UNSET_VALUE) More...
 

Detailed Description

ON_2dPoint

Constructor & Destructor Documentation

◆ ON_2dPoint() [1/14]

ON_2dPoint::ON_2dPoint ( )
default

x,y not initialized

◆ ~ON_2dPoint()

ON_2dPoint::~ON_2dPoint ( )
default

◆ ON_2dPoint() [2/14]

ON_2dPoint::ON_2dPoint ( const ON_2dPoint )
default

◆ ON_2dPoint() [3/14]

ON_2dPoint::ON_2dPoint ( double  x,
double  y 
)
explicit

◆ ON_2dPoint() [4/14]

ON_2dPoint::ON_2dPoint ( const ON_3dPoint )

from 3d point

◆ ON_2dPoint() [5/14]

ON_2dPoint::ON_2dPoint ( const ON_4dPoint h)
explicit

from 4d point - h.w must be non-zero

◆ ON_2dPoint() [6/14]

ON_2dPoint::ON_2dPoint ( const ON_2dVector )

from 2d vector

◆ ON_2dPoint() [7/14]

ON_2dPoint::ON_2dPoint ( const ON_3dVector )
explicit

from 3d vector

◆ ON_2dPoint() [8/14]

ON_2dPoint::ON_2dPoint ( const double *  )
explicit

from double[2] array

◆ ON_2dPoint() [9/14]

ON_2dPoint::ON_2dPoint ( const class ON_2fPoint )

from 2f point

◆ ON_2dPoint() [10/14]

ON_2dPoint::ON_2dPoint ( const class ON_3fPoint )
explicit

from 3f point

◆ ON_2dPoint() [11/14]

ON_2dPoint::ON_2dPoint ( const class ON_4fPoint h)
explicit

from 4f point - h.w must be non-zero

◆ ON_2dPoint() [12/14]

ON_2dPoint::ON_2dPoint ( const class ON_2fVector )
explicit

from 2f vector

◆ ON_2dPoint() [13/14]

ON_2dPoint::ON_2dPoint ( const class ON_3fVector )
explicit

from 3f vector

◆ ON_2dPoint() [14/14]

ON_2dPoint::ON_2dPoint ( const float *  )
explicit

from float[2] array

Member Function Documentation

◆ Compare()

static int ON_2dPoint::Compare ( const ON_2dPoint lhs,
const ON_2dPoint rhs 
)
static

Description: A well ordered dictionary compare function that is nan aware and can be used for robust sorting.

◆ DataCRC()

ON__UINT32 ON_2dPoint::DataCRC ( ON__UINT32  current_remainder) const

◆ DistanceTo()

double ON_2dPoint::DistanceTo ( const ON_2dPoint ) const

◆ DistanceToSquared()

double ON_2dPoint::DistanceToSquared ( const ON_2dPoint ) const

◆ IsCoincident()

bool ON_2dPoint::IsCoincident ( const ON_2dPoint P) const

In opennurbs points within ON_ZERO_TOLERANCE are generally considered to be the same. Returns: True if for each coordinate pair, |a-b| <= ON_ZERO_TOLERANCE or |a-b| <= (fabs(a)+fabs(b))*ON_RELATIVE_TOLERANCE.

◆ IsNan()

bool ON_2dPoint::IsNan ( ) const

Returns: True if any coordinate is a nan.

◆ IsNotZero()

bool ON_2dPoint::IsNotZero ( ) const

Returns: true if at lease one coordinate is not zero and no coordinates are unset or nans.

◆ IsUnset()

bool ON_2dPoint::IsUnset ( ) const

Returns: True if any coordinate is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE

◆ IsUnsetOrNan()

bool ON_2dPoint::IsUnsetOrNan ( ) const

Returns: True if any coordinate is ON_UNSET_VALUE, ON_UNSET_POSITIVE_VALUE, or a nan

◆ IsValid()

bool ON_2dPoint::IsValid ( ) const

Returns: False if any coordinate is infinite, a nan, or ON_UNSET_VALUE.

◆ IsZero()

bool ON_2dPoint::IsZero ( ) const

Returns: true if all coordinates are not zero and no coordinates are nans. false otherwise.

◆ MaximumCoordinate()

double ON_2dPoint::MaximumCoordinate ( ) const

absolute value of maximum coordinate

◆ MaximumCoordinateIndex()

int ON_2dPoint::MaximumCoordinateIndex ( ) const

◆ Midpoint()

static const ON_2dPoint ON_2dPoint::Midpoint ( const ON_2dPoint A,
const ON_2dPoint B 
)
static

Returns: (A+B)/2 Remarks: Exact when coordinates are equal and prevents overflow.

◆ MinimumCoordinate()

double ON_2dPoint::MinimumCoordinate ( ) const

absolute value of minimum coordinate

◆ MinimumCoordinateIndex()

int ON_2dPoint::MinimumCoordinateIndex ( ) const

◆ operator const double *()

ON_2dPoint::operator const double * ( ) const

◆ operator double *()

ON_2dPoint::operator double * ( )

(double*) conversion operators

◆ operator!=()

bool ON_2dPoint::operator!= ( const ON_2dPoint ) const

◆ operator*() [1/6]

double ON_2dPoint::operator* ( const ON_2dPoint ) const

dot product for points acting as vectors

◆ operator*() [2/6]

double ON_2dPoint::operator* ( const ON_2dVector ) const

dot product for points acting as vectors

◆ operator*() [3/6]

ON_2dPoint ON_2dPoint::operator* ( const ON_Xform ) const

◆ operator*() [4/6]

ON_2dPoint ON_2dPoint::operator* ( double  ) const

◆ operator*() [5/6]

ON_2dPoint ON_2dPoint::operator* ( float  ) const

◆ operator*() [6/6]

ON_2dPoint ON_2dPoint::operator* ( int  ) const

◆ operator*=()

ON_2dPoint& ON_2dPoint::operator*= ( double  )

◆ operator+() [1/8]

ON_2dPoint ON_2dPoint::operator+ ( const ON_2dPoint ) const

◆ operator+() [2/8]

ON_2dPoint ON_2dPoint::operator+ ( const ON_2dVector ) const

◆ operator+() [3/8]

ON_2dPoint ON_2dPoint::operator+ ( const ON_2fPoint ) const

◆ operator+() [4/8]

ON_2dPoint ON_2dPoint::operator+ ( const ON_2fVector ) const

◆ operator+() [5/8]

ON_3dPoint ON_2dPoint::operator+ ( const ON_3dPoint ) const

◆ operator+() [6/8]

ON_3dPoint ON_2dPoint::operator+ ( const ON_3dVector ) const

◆ operator+() [7/8]

ON_3dPoint ON_2dPoint::operator+ ( const ON_3fPoint ) const

◆ operator+() [8/8]

ON_3dPoint ON_2dPoint::operator+ ( const ON_3fVector ) const

◆ operator+=()

ON_2dPoint& ON_2dPoint::operator+= ( const ON_2dVector )

◆ operator-() [1/8]

ON_2dVector ON_2dPoint::operator- ( const ON_2dPoint ) const

◆ operator-() [2/8]

ON_2dPoint ON_2dPoint::operator- ( const ON_2dVector ) const

◆ operator-() [3/8]

ON_2dVector ON_2dPoint::operator- ( const ON_2fPoint ) const

◆ operator-() [4/8]

ON_2dPoint ON_2dPoint::operator- ( const ON_2fVector ) const

◆ operator-() [5/8]

ON_3dVector ON_2dPoint::operator- ( const ON_3dPoint ) const

◆ operator-() [6/8]

ON_3dPoint ON_2dPoint::operator- ( const ON_3dVector ) const

◆ operator-() [7/8]

ON_3dVector ON_2dPoint::operator- ( const ON_3fPoint ) const

◆ operator-() [8/8]

ON_3dPoint ON_2dPoint::operator- ( const ON_3fVector ) const

◆ operator-=()

ON_2dPoint& ON_2dPoint::operator-= ( const ON_2dVector )

◆ operator/() [1/3]

ON_2dPoint ON_2dPoint::operator/ ( double  ) const

◆ operator/() [2/3]

ON_2dPoint ON_2dPoint::operator/ ( float  ) const

◆ operator/() [3/3]

ON_2dPoint ON_2dPoint::operator/ ( int  ) const

◆ operator/=()

ON_2dPoint& ON_2dPoint::operator/= ( double  )

◆ operator<()

bool ON_2dPoint::operator< ( const ON_2dPoint ) const

◆ operator<=()

bool ON_2dPoint::operator<= ( const ON_2dPoint ) const

dictionary order comparisons

◆ operator=() [1/12]

ON_2dPoint& ON_2dPoint::operator= ( const double *  )

point = double[2] support

◆ operator=() [2/12]

ON_2dPoint& ON_2dPoint::operator= ( const float *  )

point = float[2] support

◆ operator=() [3/12]

ON_2dPoint& ON_2dPoint::operator= ( const ON_2dPoint )
default

◆ operator=() [4/12]

ON_2dPoint& ON_2dPoint::operator= ( const ON_2dVector )

◆ operator=() [5/12]

ON_2dPoint& ON_2dPoint::operator= ( const ON_2fPoint )

◆ operator=() [6/12]

ON_2dPoint& ON_2dPoint::operator= ( const ON_2fVector )

◆ operator=() [7/12]

ON_2dPoint& ON_2dPoint::operator= ( const ON_3dPoint )

◆ operator=() [8/12]

ON_2dPoint& ON_2dPoint::operator= ( const ON_3dVector )

◆ operator=() [9/12]

ON_2dPoint& ON_2dPoint::operator= ( const ON_3fPoint )

◆ operator=() [10/12]

ON_2dPoint& ON_2dPoint::operator= ( const ON_3fVector )

◆ operator=() [11/12]

ON_2dPoint& ON_2dPoint::operator= ( const ON_4dPoint )

◆ operator=() [12/12]

ON_2dPoint& ON_2dPoint::operator= ( const ON_4fPoint )

◆ operator==()

bool ON_2dPoint::operator== ( const ON_2dPoint ) const

◆ operator>()

bool ON_2dPoint::operator> ( const ON_2dPoint ) const

◆ operator>=()

bool ON_2dPoint::operator>= ( const ON_2dPoint ) const

◆ operator[]() [1/4]

double& ON_2dPoint::operator[] ( int  )

index operators mimic double[2] behavior

◆ operator[]() [2/4]

double ON_2dPoint::operator[] ( int  ) const

◆ operator[]() [3/4]

double& ON_2dPoint::operator[] ( unsigned int  )

◆ operator[]() [4/4]

double ON_2dPoint::operator[] ( unsigned int  ) const

◆ Rotate() [1/2]

void ON_2dPoint::Rotate ( double  angle,
const ON_2dPoint center 
)
Parameters
anglerotation in XY plane angle in radians
centercenter of rotation

◆ Rotate() [2/2]

void ON_2dPoint::Rotate ( double  sin_angle,
double  cos_angle,
const ON_2dPoint center 
)
Parameters
sin_anglerotation in XY plane sin(angle)
cos_anglecos(angle)
centercenter of rotation

◆ Set()

void ON_2dPoint::Set ( double  x,
double  y 
)

set 2d point value

◆ Transform()

void ON_2dPoint::Transform ( const ON_Xform )

These transform the point in place. The transformation matrix acts on the left of the point; i.e., result = transformation*point

◆ Zero()

void ON_2dPoint::Zero ( )

set all coordinates to zero;

Deprecated:
Use p = ON_2dPoint::Origin;

Member Data Documentation

◆ NanPoint

const ON_2dPoint ON_2dPoint::NanPoint
static

(ON_DBL_QNAN,ON_DBL_QNAN)

◆ Origin

const ON_2dPoint ON_2dPoint::Origin
static

(0.0,0.0)

◆ UnsetPoint

const ON_2dPoint ON_2dPoint::UnsetPoint
static

(ON_UNSET_VALUE,ON_UNSET_VALUE)

◆ x

double ON_2dPoint::x

◆ y

double ON_2dPoint::y