#include <opennurbs_point.h>

Public Member Functions

 ON_3dVector ()=default
 x,y,z not initialized More...
 
 ON_3dVector (const ON_3dVector &)=default
 
 ON_3dVector (double x, double y, double z)
 
 ON_3dVector (const ON_2dVector &)
 
 ON_3dVector (const ON_2dPoint &)
 
 ON_3dVector (const ON_3dPoint &)
 
 ON_3dVector (const double *)
 
 ON_3dVector (const ON_2fVector &)
 
 ON_3dVector (const ON_3fVector &)
 
 ON_3dVector (const ON_2fPoint &)
 
 ON_3dVector (const ON_3fPoint &)
 
 ON_3dVector (const float *)
 
 ~ON_3dVector ()=default
 
ON__UINT32 DataCRC (ON__UINT32 current_remainder) const
 
bool Decompose (const ON_3dVector &, const ON_3dVector &, const ON_3dVector &, double *, double *, double *) const
 
double Fuzz (double tolerance=ON_ZERO_TOLERANCE) const
 
bool IsNotZero () const
 
int IsParallelTo (const ON_3dVector &other, double angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE) const
 
bool IsPerpendicularTo (const ON_3dVector &other, double angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE) const
 
bool IsTiny (double tiny_tol=ON_ZERO_TOLERANCE) const
 Test a vector to see if it is very short More...
 
bool IsUnitVector () const
 
bool IsUnset () const
 
bool IsValid () const
 
bool IsZero () const
 
double Length () const
 
double LengthAndUnitize ()
 
double LengthSquared () const
 
double MaximumCoordinate () const
 
int MaximumCoordinateIndex () const
 
double MinimumCoordinate () const
 
int MinimumCoordinateIndex () const
 
 operator const double * () const
 
 operator double * ()
 (double*) conversion operators More...
 
bool operator!= (const ON_3dVector &) const
 
double operator* (const ON_3dVector &) const
 DO NOT ADD ANY MORE overrides of += or -=. More...
 
double operator* (const ON_3dPoint &) const
 
double operator* (const ON_3fVector &) const
 
ON_3dVector operator* (int) const
 
ON_3dVector operator* (float) const
 
ON_3dVector operator* (double) const
 
ON_3dVector operator* (const ON_Xform &) const
 
ON_3dVectoroperator*= (double)
 
ON_3dVector operator+ (const ON_3dVector &) const
 
ON_3dPoint operator+ (const ON_3dPoint &) const
 
ON_3dVector operator+ (const ON_2dVector &) const
 
ON_3dPoint operator+ (const ON_2dPoint &) const
 
ON_3dVector operator+ (const ON_3fVector &) const
 
ON_3dPoint operator+ (const ON_3fPoint &) const
 
ON_3dVector operator+ (const ON_2fVector &) const
 
ON_3dPoint operator+ (const ON_2fPoint &) const
 
ON_3dVectoroperator+= (const ON_3dVector &)
 
ON_3dVector operator- () const
 
ON_3dVector operator- (const ON_3dVector &) const
 
ON_3dPoint operator- (const ON_3dPoint &) const
 
ON_3dVector operator- (const ON_2dVector &) const
 
ON_3dPoint operator- (const ON_2dPoint &) const
 
ON_3dVector operator- (const ON_3fVector &) const
 
ON_3dPoint operator- (const ON_3fPoint &) const
 
ON_3dVector operator- (const ON_2fVector &) const
 
ON_3dPoint operator- (const ON_2fPoint &) const
 
ON_3dVectoroperator-= (const ON_3dVector &)
 
ON_3dVector operator/ (int) const
 
ON_3dVector operator/ (float) const
 
ON_3dVector operator/ (double) const
 
ON_3dVectoroperator/= (double)
 
bool operator< (const ON_3dVector &) const
 
bool operator<= (const ON_3dVector &) const
 dictionary order comparisons More...
 
ON_3dVectoroperator= (const ON_3dVector &)=default
 
ON_3dVectoroperator= (const ON_2dVector &)
 use implicit operator=(const ON_3dVector&) More...
 
ON_3dVectoroperator= (const ON_2dPoint &)
 
ON_3dVectoroperator= (const ON_3dPoint &)
 
ON_3dVectoroperator= (const double *)
 
ON_3dVectoroperator= (const ON_2fVector &)
 
ON_3dVectoroperator= (const ON_3fVector &)
 
ON_3dVectoroperator= (const ON_2fPoint &)
 
ON_3dVectoroperator= (const ON_3fPoint &)
 
ON_3dVectoroperator= (const float *)
 
bool operator== (const ON_3dVector &) const
 
bool operator> (const ON_3dVector &) const
 
bool operator>= (const ON_3dVector &) const
 
double & operator[] (int)
 index operators mimic double[3] behavior More...
 
double operator[] (int) const
 
double & operator[] (unsigned int)
 
double operator[] (unsigned int) const
 
bool PerpendicularTo (const ON_3dVector &)
 set this vector to be perpendicular to another vector More...
 
bool PerpendicularTo (const ON_3dPoint &, const ON_3dPoint &, const ON_3dPoint &)
 set this vector to be perpendicular to a plane defined by 3 points More...
 
void Reverse ()
 
void Rotate (double angle, const ON_3dVector &axis)
 
void Rotate (double sin_angle, double cos_angle, const ON_3dVector &axis)
 
void Set (double x, double y, double z)
 set 3d vector value More...
 
void Transform (const ON_Xform &)
 
bool Unitize ()
 
ON_3dVector UnitVector () const
 
void Zero ()
 

Static Public Member Functions

static int Compare (const ON_3dVector &lhs, const ON_3dVector &rhs)
 A well ordered dictionary compare function that is nan aware and can be used for robust sorting. More...
 
static const ON_3dVectorUnitVector (int)
 A index driven function to get unit axis vectors. More...
 

Public Attributes

double x
 
double y
 
double z
 

Static Public Attributes

static const ON_3dVector NanVector
 
static const ON_3dVector UnsetVector
 
static const ON_3dVector XAxis
 
static const ON_3dVector YAxis
 
static const ON_3dVector ZAxis
 
static const ON_3dVector ZeroVector
 

Constructor & Destructor Documentation

◆ ON_3dVector() [1/12]

ON_3dVector::ON_3dVector ( )
default

x,y,z not initialized

◆ ~ON_3dVector()

ON_3dVector::~ON_3dVector ( )
default

◆ ON_3dVector() [2/12]

ON_3dVector::ON_3dVector ( const ON_3dVector )
default

◆ ON_3dVector() [3/12]

ON_3dVector::ON_3dVector ( double  x,
double  y,
double  z 
)
explicit

◆ ON_3dVector() [4/12]

ON_3dVector::ON_3dVector ( const ON_2dVector )

◆ ON_3dVector() [5/12]

ON_3dVector::ON_3dVector ( const ON_2dPoint )
explicit

◆ ON_3dVector() [6/12]

ON_3dVector::ON_3dVector ( const ON_3dPoint )

◆ ON_3dVector() [7/12]

ON_3dVector::ON_3dVector ( const double *  )
explicit

◆ ON_3dVector() [8/12]

ON_3dVector::ON_3dVector ( const ON_2fVector )
explicit

◆ ON_3dVector() [9/12]

ON_3dVector::ON_3dVector ( const ON_3fVector )

◆ ON_3dVector() [10/12]

ON_3dVector::ON_3dVector ( const ON_2fPoint )
explicit

◆ ON_3dVector() [11/12]

ON_3dVector::ON_3dVector ( const ON_3fPoint )
explicit

◆ ON_3dVector() [12/12]

ON_3dVector::ON_3dVector ( const float *  )
explicit

Member Function Documentation

◆ Compare()

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

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

◆ DataCRC()

ON__UINT32 ON_3dVector::DataCRC ( ON__UINT32  current_remainder) const

◆ Decompose()

bool ON_3dVector::Decompose ( const ON_3dVector ,
const ON_3dVector ,
const ON_3dVector ,
double *  ,
double *  ,
double *   
) const

◆ Fuzz()

double ON_3dVector::Fuzz ( double  tolerance = ON_ZERO_TOLERANCE) const

◆ IsNotZero()

bool ON_3dVector::IsNotZero ( ) const
Returns
true if at lease one coordinate is not zero and no coordinates are nans.

◆ IsParallelTo()

int ON_3dVector::IsParallelTo ( const ON_3dVector other,
double  angle_tolerance = ON_DEFAULT_ANGLE_TOLERANCE 
) const

◆ IsPerpendicularTo()

bool ON_3dVector::IsPerpendicularTo ( const ON_3dVector other,
double  angle_tolerance = ON_DEFAULT_ANGLE_TOLERANCE 
) const

◆ IsTiny()

bool ON_3dVector::IsTiny ( double  tiny_tol = ON_ZERO_TOLERANCE) const

Test a vector to see if it is very short

Parameters
tiny_tol[in] (default = ON_ZERO_TOLERANCE) a nonzero value used as the coordinate zero tolerance.
Returns

( fabs(x) <= tiny_tol && fabs(y) <= tiny_tol && fabs(z) <= tiny_tol )

◆ IsUnitVector()

bool ON_3dVector::IsUnitVector ( ) const
Returns
true if vector is valid and has length 1.

◆ IsUnset()

bool ON_3dVector::IsUnset ( ) const
Returns
True if any coordinate is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE

◆ IsValid()

bool ON_3dVector::IsValid ( ) const
Returns
False if any coordinate is infinte, a nan, or ON_UNSET_VALUE.

◆ IsZero()

bool ON_3dVector::IsZero ( ) const
Returns
true if vector is the zero vector.

◆ Length()

double ON_3dVector::Length ( ) const

◆ LengthAndUnitize()

double ON_3dVector::LengthAndUnitize ( )

◆ LengthSquared()

double ON_3dVector::LengthSquared ( ) const

◆ MaximumCoordinate()

double ON_3dVector::MaximumCoordinate ( ) const

◆ MaximumCoordinateIndex()

int ON_3dVector::MaximumCoordinateIndex ( ) const

◆ MinimumCoordinate()

double ON_3dVector::MinimumCoordinate ( ) const

◆ MinimumCoordinateIndex()

int ON_3dVector::MinimumCoordinateIndex ( ) const

◆ operator const double *()

ON_3dVector::operator const double * ( ) const

◆ operator double *()

ON_3dVector::operator double * ( )

(double*) conversion operators

◆ operator!=()

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

◆ operator*() [1/7]

double ON_3dVector::operator* ( const ON_3dVector ) const

DO NOT ADD ANY MORE overrides of += or -=.

◆ operator*() [2/7]

double ON_3dVector::operator* ( const ON_3dPoint ) const

◆ operator*() [3/7]

double ON_3dVector::operator* ( const ON_3fVector ) const

◆ operator*() [4/7]

ON_3dVector ON_3dVector::operator* ( int  ) const

◆ operator*() [5/7]

ON_3dVector ON_3dVector::operator* ( float  ) const

◆ operator*() [6/7]

ON_3dVector ON_3dVector::operator* ( double  ) const

◆ operator*() [7/7]

ON_3dVector ON_3dVector::operator* ( const ON_Xform ) const

◆ operator*=()

ON_3dVector& ON_3dVector::operator*= ( double  )

◆ operator+() [1/8]

ON_3dVector ON_3dVector::operator+ ( const ON_3dVector ) const

◆ operator+() [2/8]

ON_3dPoint ON_3dVector::operator+ ( const ON_3dPoint ) const

◆ operator+() [3/8]

ON_3dVector ON_3dVector::operator+ ( const ON_2dVector ) const

◆ operator+() [4/8]

ON_3dPoint ON_3dVector::operator+ ( const ON_2dPoint ) const

◆ operator+() [5/8]

ON_3dVector ON_3dVector::operator+ ( const ON_3fVector ) const

◆ operator+() [6/8]

ON_3dPoint ON_3dVector::operator+ ( const ON_3fPoint ) const

◆ operator+() [7/8]

ON_3dVector ON_3dVector::operator+ ( const ON_2fVector ) const

◆ operator+() [8/8]

ON_3dPoint ON_3dVector::operator+ ( const ON_2fPoint ) const

◆ operator+=()

ON_3dVector& ON_3dVector::operator+= ( const ON_3dVector )

◆ operator-() [1/9]

ON_3dVector ON_3dVector::operator- ( ) const

◆ operator-() [2/9]

ON_3dVector ON_3dVector::operator- ( const ON_3dVector ) const

◆ operator-() [3/9]

ON_3dPoint ON_3dVector::operator- ( const ON_3dPoint ) const

◆ operator-() [4/9]

ON_3dVector ON_3dVector::operator- ( const ON_2dVector ) const

◆ operator-() [5/9]

ON_3dPoint ON_3dVector::operator- ( const ON_2dPoint ) const

◆ operator-() [6/9]

ON_3dVector ON_3dVector::operator- ( const ON_3fVector ) const

◆ operator-() [7/9]

ON_3dPoint ON_3dVector::operator- ( const ON_3fPoint ) const

◆ operator-() [8/9]

ON_3dVector ON_3dVector::operator- ( const ON_2fVector ) const

◆ operator-() [9/9]

ON_3dPoint ON_3dVector::operator- ( const ON_2fPoint ) const

◆ operator-=()

ON_3dVector& ON_3dVector::operator-= ( const ON_3dVector )

◆ operator/() [1/3]

ON_3dVector ON_3dVector::operator/ ( int  ) const

◆ operator/() [2/3]

ON_3dVector ON_3dVector::operator/ ( float  ) const

◆ operator/() [3/3]

ON_3dVector ON_3dVector::operator/ ( double  ) const

◆ operator/=()

ON_3dVector& ON_3dVector::operator/= ( double  )

◆ operator<()

bool ON_3dVector::operator< ( const ON_3dVector ) const

◆ operator<=()

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

dictionary order comparisons

◆ operator=() [1/10]

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

◆ operator=() [2/10]

ON_3dVector& ON_3dVector::operator= ( const ON_2dVector )

◆ operator=() [3/10]

ON_3dVector& ON_3dVector::operator= ( const ON_2dPoint )

◆ operator=() [4/10]

ON_3dVector& ON_3dVector::operator= ( const ON_3dPoint )

◆ operator=() [5/10]

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

◆ operator=() [6/10]

ON_3dVector& ON_3dVector::operator= ( const ON_2fVector )

◆ operator=() [7/10]

ON_3dVector& ON_3dVector::operator= ( const ON_3fVector )

◆ operator=() [8/10]

ON_3dVector& ON_3dVector::operator= ( const ON_2fPoint )

◆ operator=() [9/10]

ON_3dVector& ON_3dVector::operator= ( const ON_3fPoint )

◆ operator=() [10/10]

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

◆ operator==()

bool ON_3dVector::operator== ( const ON_3dVector ) const

◆ operator>()

bool ON_3dVector::operator> ( const ON_3dVector ) const

◆ operator>=()

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

◆ operator[]() [1/4]

double& ON_3dVector::operator[] ( int  )

index operators mimic double[3] behavior

◆ operator[]() [2/4]

double ON_3dVector::operator[] ( int  ) const

◆ operator[]() [3/4]

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

◆ operator[]() [4/4]

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

◆ PerpendicularTo() [1/2]

bool ON_3dVector::PerpendicularTo ( const ON_3dVector )

set this vector to be perpendicular to another vector

◆ PerpendicularTo() [2/2]

bool ON_3dVector::PerpendicularTo ( const ON_3dPoint ,
const ON_3dPoint ,
const ON_3dPoint  
)

set this vector to be perpendicular to a plane defined by 3 points

◆ Reverse()

void ON_3dVector::Reverse ( )

◆ Rotate() [1/2]

void ON_3dVector::Rotate ( double  angle,
const ON_3dVector axis 
)

◆ Rotate() [2/2]

void ON_3dVector::Rotate ( double  sin_angle,
double  cos_angle,
const ON_3dVector axis 
)

◆ Set()

void ON_3dVector::Set ( double  x,
double  y,
double  z 
)

set 3d vector value

◆ Transform()

void ON_3dVector::Transform ( const ON_Xform )

◆ Unitize()

bool ON_3dVector::Unitize ( )

◆ UnitVector() [1/2]

static const ON_3dVector& ON_3dVector::UnitVector ( int  )
static

A index driven function to get unit axis vectors.

Parameters
index[in] 0 returns (1,0,0), 1 returns (0,1,0), 2 returns (0,0,1)
Returns
Unit 3d vector with vector[i] = (i==index)?1:0;

◆ UnitVector() [2/2]

ON_3dVector ON_3dVector::UnitVector ( ) const
Returns
If this is a valid non-zero vector, a unit vector parallel to this is returned. Otherwise the zero vector is returned.

◆ Zero()

void ON_3dVector::Zero ( )

Member Data Documentation

◆ NanVector

const ON_3dVector ON_3dVector::NanVector
static

◆ UnsetVector

const ON_3dVector ON_3dVector::UnsetVector
static

◆ x

double ON_3dVector::x

◆ XAxis

const ON_3dVector ON_3dVector::XAxis
static

◆ y

double ON_3dVector::y

◆ YAxis

const ON_3dVector ON_3dVector::YAxis
static

◆ z

double ON_3dVector::z

◆ ZAxis

const ON_3dVector ON_3dVector::ZAxis
static

◆ ZeroVector

const ON_3dVector ON_3dVector::ZeroVector
static