Rhino C++ API
8.14
|
#include <opennurbs_point.h>
Public Member Functions | |
ON_3dVector ()=default | |
x,y,z not initialized More... | |
ON_3dVector (const double *) | |
from double[3] array More... | |
ON_3dVector (const float *) | |
from float[3] array More... | |
ON_3dVector (const ON_2dPoint &) | |
from 2d point More... | |
ON_3dVector (const ON_2dVector &) | |
from 2d vector More... | |
ON_3dVector (const ON_2fPoint &) | |
from 2f point More... | |
ON_3dVector (const ON_2fVector &) | |
from 2f vector More... | |
ON_3dVector (const ON_3dPoint &) | |
from 3d point More... | |
ON_3dVector (const ON_3dVector &)=default | |
ON_3dVector (const ON_3fPoint &) | |
from 3f point More... | |
ON_3dVector (const ON_3fVector &) | |
from 3f vector More... | |
ON_3dVector (double x, double y, double z) | |
~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 |
tolerance to use when comparing 3d vectors More... | |
bool | IsNan () 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 |
bool | IsUnitVector () const |
bool | IsUnset () const |
bool | IsUnsetOrNan () const |
bool | IsValid () const |
bool | IsZero () const |
double | Length () const |
double | LengthAndUnitize () |
unitizes and returns initial length More... | |
double | LengthSquared () 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_3dVector &) const |
double | operator* (const ON_3dPoint &) const |
inner (dot) product More... | |
double | operator* (const ON_3dVector &) const |
DO NOT ADD ANY MORE overrides of += or -=. More... | |
double | operator* (const ON_3fVector &) const |
inner (dot) product More... | |
ON_3dVector | operator* (const ON_Xform &) const |
ON_3dVector | operator* (double) const |
ON_3dVector | operator* (float) const |
ON_3dVector | operator* (int) const |
ON_3dVector & | operator*= (double) |
ON_3dPoint | operator+ (const ON_2dPoint &) const |
ON_3dVector | operator+ (const ON_2dVector &) const |
ON_3dPoint | operator+ (const ON_2fPoint &) const |
ON_3dVector | operator+ (const ON_2fVector &) const |
ON_3dPoint | operator+ (const ON_3dPoint &) const |
ON_3dVector | operator+ (const ON_3dVector &) const |
ON_3dPoint | operator+ (const ON_3fPoint &) const |
ON_3dVector | operator+ (const ON_3fVector &) const |
ON_3dVector & | operator+= (const ON_3dVector &) |
ON_3dVector | operator- () const |
ON_3dPoint | operator- (const ON_2dPoint &) const |
ON_3dVector | operator- (const ON_2dVector &) const |
ON_3dPoint | operator- (const ON_2fPoint &) const |
ON_3dVector | operator- (const ON_2fVector &) const |
ON_3dPoint | operator- (const ON_3dPoint &) const |
ON_3dVector | operator- (const ON_3dVector &) const |
ON_3dPoint | operator- (const ON_3fPoint &) const |
ON_3dVector | operator- (const ON_3fVector &) const |
ON_3dVector & | operator-= (const ON_3dVector &) |
ON_3dVector | operator/ (double) const |
ON_3dVector | operator/ (float) const |
ON_3dVector | operator/ (int) const |
ON_3dVector & | operator/= (double) |
bool | operator< (const ON_3dVector &) const |
bool | operator<= (const ON_3dVector &) const |
dictionary order comparisons More... | |
ON_3dVector & | operator= (const double *) |
vector = double[3] support More... | |
ON_3dVector & | operator= (const float *) |
vector = float[3] support More... | |
ON_3dVector & | operator= (const ON_2dPoint &) |
ON_3dVector & | operator= (const ON_2dVector &) |
use implicit operator=(const ON_3dVector&) More... | |
ON_3dVector & | operator= (const ON_2fPoint &) |
ON_3dVector & | operator= (const ON_2fVector &) |
ON_3dVector & | operator= (const ON_3dPoint &) |
ON_3dVector & | operator= (const ON_3dVector &)=default |
ON_3dVector & | operator= (const ON_3fPoint &) |
ON_3dVector & | operator= (const ON_3fVector &) |
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 |
const ON_3dVector | Perpendicular (ON_3dVector failure_result) const |
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... | |
bool | PerpendicularTo (const ON_3dVector &) |
set this vector to be perpendicular to another vector More... | |
void | Reverse () |
negate all coordinates More... | |
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 () |
returns false if vector has zero length More... | |
ON_3dVector | UnitVector () const |
void | Zero () |
set all coordinates to zero; More... | |
Static Public Member Functions | |
static double | Angle (const ON_3dVector &A, const ON_3dVector &B) |
static int | Compare (const ON_3dVector &lhs, const ON_3dVector &rhs) |
static const ON_3dVector | CrossProduct (ON_3dVector A, ON_3dVector B) |
static double | DotProduct (ON_3dVector A, ON_3dVector B) |
static const ON_3dVector & | UnitVector (int) |
Public Attributes | |
double | x |
double | y |
double | z |
Static Public Attributes | |
static const ON_3dVector | NanVector |
(ON_DBL_QNAN,ON_DBL_QNAN,ON_DBL_QNAN) More... | |
static const ON_3dVector | UnsetVector |
(ON_UNSET_VALUE,ON_UNSET_VALUE,ON_UNSET_VALUE) More... | |
static const ON_3dVector | XAxis |
(1.0,0.0,0.0) More... | |
static const ON_3dVector | YAxis |
(0.0,1.0,0.0) More... | |
static const ON_3dVector | ZAxis |
(0.0,0.0,1.0) More... | |
static const ON_3dVector | ZeroVector |
(0.0,0.0,0.0) More... | |
|
default |
x,y,z not initialized
|
default |
|
default |
|
explicit |
ON_3dVector::ON_3dVector | ( | const ON_2dVector & | ) |
from 2d vector
|
explicit |
from 2d point
ON_3dVector::ON_3dVector | ( | const ON_3dPoint & | ) |
from 3d point
|
explicit |
from double[3] array
|
explicit |
from 2f vector
ON_3dVector::ON_3dVector | ( | const ON_3fVector & | ) |
from 3f vector
|
explicit |
from 2f point
|
explicit |
from 3f point
|
explicit |
from float[3] array
|
static |
Angle (in radians) between two vectors. A and B must be non-zero vectors Returns 0<= angle <= ON_PI Note: The function is symmetric, i.e Angle(A,B) = Angle(B,A) This function is always accurate, in particular for nearly parallel, anti-parallel or perpendicular vectors
|
static |
Description: A well ordered dictionary compare function that is nan aware and can be used for robust sorting.
|
static |
ON__UINT32 ON_3dVector::DataCRC | ( | ON__UINT32 | current_remainder | ) | const |
bool ON_3dVector::Decompose | ( | const ON_3dVector & | , |
const ON_3dVector & | , | ||
const ON_3dVector & | , | ||
double * | , | ||
double * | , | ||
double * | |||
) | const |
|
static |
double ON_3dVector::Fuzz | ( | double | tolerance = ON_ZERO_TOLERANCE | ) | const |
tolerance to use when comparing 3d vectors
bool ON_3dVector::IsNan | ( | ) | const |
Returns: True if any coordinate is a nan.
bool ON_3dVector::IsNotZero | ( | ) | const |
Returns: true if at lease one coordinate is not zero and no coordinates are unset or nans.
int ON_3dVector::IsParallelTo | ( | const ON_3dVector & | other, |
double | angle_tolerance = ON_DEFAULT_ANGLE_TOLERANCE |
||
) | const |
other | returns 1: this and other vectors are parallel -1: this and other vectors are anti-parallel 0: this and other vectors are not parallel or at least one of the vectors is zero other vector |
angle_tolerance | optional angle tolerance (radians) |
bool ON_3dVector::IsPerpendicularTo | ( | const ON_3dVector & | other, |
double | angle_tolerance = ON_DEFAULT_ANGLE_TOLERANCE |
||
) | const |
other | returns true: this and other vectors are perpendicular false: this and other vectors are not perpendicular or at least one of the vectors is zero other vector |
angle_tolerance | optional angle tolerance (radians) |
bool ON_3dVector::IsTiny | ( | double | tiny_tol = ON_ZERO_TOLERANCE | ) | const |
Description: 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 )
tiny_tol | tiny_tol |
bool ON_3dVector::IsUnitVector | ( | ) | const |
Returns: true if vector is valid and has length 1.
bool ON_3dVector::IsUnset | ( | ) | const |
Returns: True if any coordinate is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
bool ON_3dVector::IsUnsetOrNan | ( | ) | const |
Returns: True if any coordinate is ON_UNSET_VALUE, ON_UNSET_POSITIVE_VALUE, or a nan
bool ON_3dVector::IsValid | ( | ) | const |
Returns: False if any coordinate is infinite, a nan, or ON_UNSET_VALUE.
bool ON_3dVector::IsZero | ( | ) | const |
Returns: true if vector is the zero vector.
double ON_3dVector::Length | ( | ) | const |
double ON_3dVector::LengthAndUnitize | ( | ) |
unitizes and returns initial length
double ON_3dVector::LengthSquared | ( | ) | const |
double ON_3dVector::MaximumCoordinate | ( | ) | const |
absolute value of maximum coordinate
int ON_3dVector::MaximumCoordinateIndex | ( | ) | const |
double ON_3dVector::MinimumCoordinate | ( | ) | const |
absolute value of minimum coordinate
int ON_3dVector::MinimumCoordinateIndex | ( | ) | const |
ON_3dVector::operator const double * | ( | ) | const |
ON_3dVector::operator double * | ( | ) |
(double*) conversion operators
bool ON_3dVector::operator!= | ( | const ON_3dVector & | ) | const |
double ON_3dVector::operator* | ( | const ON_3dPoint & | ) | const |
inner (dot) product
double ON_3dVector::operator* | ( | const ON_3dVector & | ) | const |
DO NOT ADD ANY MORE overrides of += or -=.
inner (dot) product
double ON_3dVector::operator* | ( | const ON_3fVector & | ) | const |
inner (dot) product
ON_3dVector ON_3dVector::operator* | ( | const ON_Xform & | ) | const |
ON_3dVector ON_3dVector::operator* | ( | double | ) | const |
ON_3dVector ON_3dVector::operator* | ( | float | ) | const |
ON_3dVector ON_3dVector::operator* | ( | int | ) | const |
ON_3dVector& ON_3dVector::operator*= | ( | double | ) |
ON_3dPoint ON_3dVector::operator+ | ( | const ON_2dPoint & | ) | const |
ON_3dVector ON_3dVector::operator+ | ( | const ON_2dVector & | ) | const |
ON_3dPoint ON_3dVector::operator+ | ( | const ON_2fPoint & | ) | const |
ON_3dVector ON_3dVector::operator+ | ( | const ON_2fVector & | ) | const |
ON_3dPoint ON_3dVector::operator+ | ( | const ON_3dPoint & | ) | const |
ON_3dVector ON_3dVector::operator+ | ( | const ON_3dVector & | ) | const |
ON_3dPoint ON_3dVector::operator+ | ( | const ON_3fPoint & | ) | const |
ON_3dVector ON_3dVector::operator+ | ( | const ON_3fVector & | ) | const |
ON_3dVector& ON_3dVector::operator+= | ( | const ON_3dVector & | ) |
ON_3dVector ON_3dVector::operator- | ( | ) | const |
ON_3dPoint ON_3dVector::operator- | ( | const ON_2dPoint & | ) | const |
ON_3dVector ON_3dVector::operator- | ( | const ON_2dVector & | ) | const |
ON_3dPoint ON_3dVector::operator- | ( | const ON_2fPoint & | ) | const |
ON_3dVector ON_3dVector::operator- | ( | const ON_2fVector & | ) | const |
ON_3dPoint ON_3dVector::operator- | ( | const ON_3dPoint & | ) | const |
ON_3dVector ON_3dVector::operator- | ( | const ON_3dVector & | ) | const |
ON_3dPoint ON_3dVector::operator- | ( | const ON_3fPoint & | ) | const |
ON_3dVector ON_3dVector::operator- | ( | const ON_3fVector & | ) | const |
ON_3dVector& ON_3dVector::operator-= | ( | const ON_3dVector & | ) |
ON_3dVector ON_3dVector::operator/ | ( | double | ) | const |
ON_3dVector ON_3dVector::operator/ | ( | float | ) | const |
ON_3dVector ON_3dVector::operator/ | ( | int | ) | const |
ON_3dVector& ON_3dVector::operator/= | ( | double | ) |
bool ON_3dVector::operator< | ( | const ON_3dVector & | ) | const |
bool ON_3dVector::operator<= | ( | const ON_3dVector & | ) | const |
dictionary order comparisons
ON_3dVector& ON_3dVector::operator= | ( | const double * | ) |
vector = double[3] support
ON_3dVector& ON_3dVector::operator= | ( | const float * | ) |
vector = float[3] support
ON_3dVector& ON_3dVector::operator= | ( | const ON_2dPoint & | ) |
ON_3dVector& ON_3dVector::operator= | ( | const ON_2dVector & | ) |
use implicit operator=(const ON_3dVector&)
ON_3dVector& ON_3dVector::operator= | ( | const ON_2fPoint & | ) |
ON_3dVector& ON_3dVector::operator= | ( | const ON_2fVector & | ) |
ON_3dVector& ON_3dVector::operator= | ( | const ON_3dPoint & | ) |
|
default |
ON_3dVector& ON_3dVector::operator= | ( | const ON_3fPoint & | ) |
ON_3dVector& ON_3dVector::operator= | ( | const ON_3fVector & | ) |
bool ON_3dVector::operator== | ( | const ON_3dVector & | ) | const |
bool ON_3dVector::operator> | ( | const ON_3dVector & | ) | const |
bool ON_3dVector::operator>= | ( | const ON_3dVector & | ) | const |
double& ON_3dVector::operator[] | ( | int | ) |
index operators mimic double[3] behavior
double ON_3dVector::operator[] | ( | int | ) | const |
double& ON_3dVector::operator[] | ( | unsigned int | ) |
double ON_3dVector::operator[] | ( | unsigned int | ) | const |
const ON_3dVector ON_3dVector::Perpendicular | ( | ON_3dVector | failure_result | ) | const |
Parameters: failure_result - [in] vector to return if this is zero or unset. When in doubt, pass ON_3dVector::NanVector. Returns: If this is nonzero, a vector perpendicular to this. The returned vector is not unitized. Otherwise failure_result is returned.
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
bool ON_3dVector::PerpendicularTo | ( | const ON_3dVector & | ) |
set this vector to be perpendicular to another vector
void ON_3dVector::Reverse | ( | ) |
negate all coordinates
void ON_3dVector::Rotate | ( | double | angle, |
const ON_3dVector & | axis | ||
) |
angle | angle in radians |
axis | axis of rotation |
void ON_3dVector::Rotate | ( | double | sin_angle, |
double | cos_angle, | ||
const ON_3dVector & | axis | ||
) |
sin_angle | sin(angle) |
cos_angle | cos(angle) |
axis | axis of rotation |
void ON_3dVector::Set | ( | double | x, |
double | y, | ||
double | z | ||
) |
set 3d vector value
void ON_3dVector::Transform | ( | const ON_Xform & | ) |
These transform the vector in place. The transformation matrix acts on the left of the vector; i.e., result = transformation*vector
bool ON_3dVector::Unitize | ( | ) |
returns false if vector has zero length
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.
|
static |
Description: 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;
void ON_3dVector::Zero | ( | ) |
set all coordinates to zero;
|
static |
(ON_DBL_QNAN,ON_DBL_QNAN,ON_DBL_QNAN)
|
static |
(ON_UNSET_VALUE,ON_UNSET_VALUE,ON_UNSET_VALUE)
double ON_3dVector::x |
|
static |
(1.0,0.0,0.0)
double ON_3dVector::y |
|
static |
(0.0,1.0,0.0)
double ON_3dVector::z |
|
static |
(0.0,0.0,1.0)
|
static |
(0.0,0.0,0.0)