Rhino C++ API
8.13
|
#include <opennurbs_point.h>
Public Member Functions | |
ON_2dVector ()=default | |
x,y not initialized More... | |
ON_2dVector (const double *) | |
from double[2] array More... | |
ON_2dVector (const float *) | |
from double[2] array More... | |
ON_2dVector (const ON_2dPoint &) | |
from 2d point More... | |
ON_2dVector (const ON_2dVector &)=default | |
ON_2dVector (const ON_2fPoint &) | |
from 2f point More... | |
ON_2dVector (const ON_2fVector &) | |
from 2f vector More... | |
ON_2dVector (const ON_3dPoint &) | |
from 3d point More... | |
ON_2dVector (const ON_3dVector &) | |
from 3d vector More... | |
ON_2dVector (const ON_3fPoint &) | |
from 3f point More... | |
ON_2dVector (const ON_3fVector &) | |
from 3f vector More... | |
ON_2dVector (double x, double y) | |
~ON_2dVector ()=default | |
ON__UINT32 | DataCRC (ON__UINT32 current_remainder) const |
bool | Decompose (const ON_2dVector &, const ON_2dVector &, double *, double *) const |
bool | IsNan () const |
bool | IsNotZero () const |
int | IsParallelTo (const ON_2dVector &other, double angle_tolerance=ON_DEFAULT_ANGLE_TOLERANCE) const |
bool | IsPerpendicularTo (const ON_2dVector &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 | 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_2dVector &) const |
double | operator* (const ON_2dPoint &) const |
inner (dot) product (point acting as vector) More... | |
double | operator* (const ON_2dVector &) const |
DO NOT ADD ANY MORE overrides of += or -=. More... | |
double | operator* (const ON_2fVector &) const |
inner (dot) product More... | |
ON_2dVector | operator* (const ON_Xform &) const |
ON_2dVector | operator* (double) const |
ON_2dVector | operator* (float) const |
ON_2dVector | operator* (int) const |
ON_2dVector & | operator*= (double) |
ON_2dPoint | operator+ (const ON_2dPoint &) const |
ON_2dVector | operator+ (const ON_2dVector &) const |
ON_2dPoint | operator+ (const ON_2fPoint &) const |
ON_2dVector | 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_2dVector & | operator+= (const ON_2dVector &) |
ON_2dVector | operator- () const |
ON_2dPoint | operator- (const ON_2dPoint &) const |
ON_2dVector | operator- (const ON_2dVector &) const |
ON_2dPoint | operator- (const ON_2fPoint &) const |
ON_2dVector | 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_2dVector & | operator-= (const ON_2dVector &) |
ON_2dVector | operator/ (double) const |
ON_2dVector | operator/ (float) const |
ON_2dVector | operator/ (int) const |
ON_2dVector & | operator/= (double) |
bool | operator< (const ON_2dVector &) const |
bool | operator<= (const ON_2dVector &) const |
dictionary order comparisons More... | |
ON_2dVector & | operator= (const double *) |
vector = double[2] support More... | |
ON_2dVector & | operator= (const float *) |
vector = float[2] support More... | |
ON_2dVector & | operator= (const ON_2dPoint &) |
ON_2dVector & | operator= (const ON_2dVector &)=default |
ON_2dVector & | operator= (const ON_2fPoint &) |
ON_2dVector & | operator= (const ON_2fVector &) |
ON_2dVector & | operator= (const ON_3dPoint &) |
ON_2dVector & | operator= (const ON_3dVector &) |
use implicit operator=(const ON_2dVector&) More... | |
ON_2dVector & | operator= (const ON_3fPoint &) |
ON_2dVector & | operator= (const ON_3fVector &) |
bool | operator== (const ON_2dVector &) const |
bool | operator> (const ON_2dVector &) const |
bool | operator>= (const ON_2dVector &) const |
double & | operator[] (int) |
index operators mimic double[2] behavior More... | |
double | operator[] (int) const |
double & | operator[] (unsigned int) |
double | operator[] (unsigned int) const |
bool | PerpendicularTo (const ON_2dPoint &, const ON_2dPoint &) |
set this vector to be perpendicular to a line defined by 2 points More... | |
bool | PerpendicularTo (const ON_2dVector &) |
set this vector to be perpendicular to another vector More... | |
void | Reverse () |
negate all coordinates More... | |
void | Rotate (double angle) |
void | Rotate (double sin_angle, double cos_angle) |
void | Set (double x, double y) |
set 2d vector value More... | |
void | Transform (const ON_Xform &) |
bool | Unitize () |
returns false if vector has zero length More... | |
ON_2dVector | UnitVector () const |
double | WedgeProduct (const ON_2dVector &B) const |
void | Zero () |
set all coordinates to zero; More... | |
Static Public Member Functions | |
static int | Compare (const ON_2dVector &lhs, const ON_2dVector &rhs) |
static double | SignedAngle (const ON_2dVector &A, const ON_2dVector &B) |
static const ON_2dVector & | UnitVector (int) |
Public Attributes | |
double | x |
double | y |
Static Public Attributes | |
static const ON_2dVector | NanVector |
(ON_DBL_QNAN,ON_DBL_QNAN) More... | |
static const ON_2dVector | UnsetVector |
(ON_UNSET_VALUE,ON_UNSET_VALUE) More... | |
static const ON_2dVector | XAxis |
(1.0,0.0) More... | |
static const ON_2dVector | YAxis |
(0.0,1.0) More... | |
static const ON_2dVector | ZeroVector |
(0.0,0.0) More... | |
|
default |
x,y not initialized
|
default |
|
default |
|
explicit |
|
explicit |
from 3d vector
ON_2dVector::ON_2dVector | ( | const ON_2dPoint & | ) |
from 2d point
|
explicit |
from 3d point
|
explicit |
from double[2] array
ON_2dVector::ON_2dVector | ( | const ON_2fVector & | ) |
from 2f vector
|
explicit |
from 3f vector
|
explicit |
from 2f point
|
explicit |
from 3f point
|
explicit |
from double[2] array
|
static |
Description: A well ordered dictionary compare function that is nan aware and can be used for robust sorting.
ON__UINT32 ON_2dVector::DataCRC | ( | ON__UINT32 | current_remainder | ) | const |
bool ON_2dVector::Decompose | ( | const ON_2dVector & | , |
const ON_2dVector & | , | ||
double * | , | ||
double * | |||
) | const |
bool ON_2dVector::IsNan | ( | ) | const |
Returns: True if any coordinate is a nan.
bool ON_2dVector::IsNotZero | ( | ) | const |
Returns: true if at lease one coordinate is not zero and no coordinates are unset or nans.
int ON_2dVector::IsParallelTo | ( | const ON_2dVector & | 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_2dVector::IsPerpendicularTo | ( | const ON_2dVector & | 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_2dVector::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 )
tiny_tol | tiny_tol |
bool ON_2dVector::IsUnitVector | ( | ) | const |
Returns: true if vector is valid and has length 1.
bool ON_2dVector::IsUnset | ( | ) | const |
Returns: True if any coordinate is ON_UNSET_VALUE or ON_UNSET_POSITIVE_VALUE
bool ON_2dVector::IsUnsetOrNan | ( | ) | const |
Returns: True if any coordinate is ON_UNSET_VALUE, ON_UNSET_POSITIVE_VALUE, or a nan
bool ON_2dVector::IsValid | ( | ) | const |
Returns: False if any coordinate is infinite, a nan, or ON_UNSET_VALUE.
bool ON_2dVector::IsZero | ( | ) | const |
Returns: true if vector is the zero vector.
double ON_2dVector::Length | ( | ) | const |
double ON_2dVector::LengthSquared | ( | ) | const |
double ON_2dVector::MaximumCoordinate | ( | ) | const |
absolute value of maximum coordinate
int ON_2dVector::MaximumCoordinateIndex | ( | ) | const |
double ON_2dVector::MinimumCoordinate | ( | ) | const |
absolute value of minimum coordinate
int ON_2dVector::MinimumCoordinateIndex | ( | ) | const |
ON_2dVector::operator const double * | ( | ) | const |
ON_2dVector::operator double * | ( | ) |
(double*) conversion operators
bool ON_2dVector::operator!= | ( | const ON_2dVector & | ) | const |
double ON_2dVector::operator* | ( | const ON_2dPoint & | ) | const |
inner (dot) product (point acting as vector)
double ON_2dVector::operator* | ( | const ON_2dVector & | ) | const |
DO NOT ADD ANY MORE overrides of += or -=.
inner (dot) product
double ON_2dVector::operator* | ( | const ON_2fVector & | ) | const |
inner (dot) product
ON_2dVector ON_2dVector::operator* | ( | const ON_Xform & | ) | const |
ON_2dVector ON_2dVector::operator* | ( | double | ) | const |
ON_2dVector ON_2dVector::operator* | ( | float | ) | const |
ON_2dVector ON_2dVector::operator* | ( | int | ) | const |
ON_2dVector& ON_2dVector::operator*= | ( | double | ) |
ON_2dPoint ON_2dVector::operator+ | ( | const ON_2dPoint & | ) | const |
ON_2dVector ON_2dVector::operator+ | ( | const ON_2dVector & | ) | const |
ON_2dPoint ON_2dVector::operator+ | ( | const ON_2fPoint & | ) | const |
ON_2dVector ON_2dVector::operator+ | ( | const ON_2fVector & | ) | const |
ON_3dPoint ON_2dVector::operator+ | ( | const ON_3dPoint & | ) | const |
ON_3dVector ON_2dVector::operator+ | ( | const ON_3dVector & | ) | const |
ON_3dPoint ON_2dVector::operator+ | ( | const ON_3fPoint & | ) | const |
ON_3dVector ON_2dVector::operator+ | ( | const ON_3fVector & | ) | const |
ON_2dVector& ON_2dVector::operator+= | ( | const ON_2dVector & | ) |
ON_2dVector ON_2dVector::operator- | ( | ) | const |
ON_2dPoint ON_2dVector::operator- | ( | const ON_2dPoint & | ) | const |
ON_2dVector ON_2dVector::operator- | ( | const ON_2dVector & | ) | const |
ON_2dPoint ON_2dVector::operator- | ( | const ON_2fPoint & | ) | const |
ON_2dVector ON_2dVector::operator- | ( | const ON_2fVector & | ) | const |
ON_3dPoint ON_2dVector::operator- | ( | const ON_3dPoint & | ) | const |
ON_3dVector ON_2dVector::operator- | ( | const ON_3dVector & | ) | const |
ON_3dPoint ON_2dVector::operator- | ( | const ON_3fPoint & | ) | const |
ON_3dVector ON_2dVector::operator- | ( | const ON_3fVector & | ) | const |
ON_2dVector& ON_2dVector::operator-= | ( | const ON_2dVector & | ) |
ON_2dVector ON_2dVector::operator/ | ( | double | ) | const |
ON_2dVector ON_2dVector::operator/ | ( | float | ) | const |
ON_2dVector ON_2dVector::operator/ | ( | int | ) | const |
ON_2dVector& ON_2dVector::operator/= | ( | double | ) |
bool ON_2dVector::operator< | ( | const ON_2dVector & | ) | const |
bool ON_2dVector::operator<= | ( | const ON_2dVector & | ) | const |
dictionary order comparisons
ON_2dVector& ON_2dVector::operator= | ( | const double * | ) |
vector = double[2] support
ON_2dVector& ON_2dVector::operator= | ( | const float * | ) |
vector = float[2] support
ON_2dVector& ON_2dVector::operator= | ( | const ON_2dPoint & | ) |
|
default |
ON_2dVector& ON_2dVector::operator= | ( | const ON_2fPoint & | ) |
ON_2dVector& ON_2dVector::operator= | ( | const ON_2fVector & | ) |
ON_2dVector& ON_2dVector::operator= | ( | const ON_3dPoint & | ) |
ON_2dVector& ON_2dVector::operator= | ( | const ON_3dVector & | ) |
use implicit operator=(const ON_2dVector&)
ON_2dVector& ON_2dVector::operator= | ( | const ON_3fPoint & | ) |
ON_2dVector& ON_2dVector::operator= | ( | const ON_3fVector & | ) |
bool ON_2dVector::operator== | ( | const ON_2dVector & | ) | const |
bool ON_2dVector::operator> | ( | const ON_2dVector & | ) | const |
bool ON_2dVector::operator>= | ( | const ON_2dVector & | ) | const |
double& ON_2dVector::operator[] | ( | int | ) |
index operators mimic double[2] behavior
double ON_2dVector::operator[] | ( | int | ) | const |
double& ON_2dVector::operator[] | ( | unsigned int | ) |
double ON_2dVector::operator[] | ( | unsigned int | ) | const |
bool ON_2dVector::PerpendicularTo | ( | const ON_2dPoint & | , |
const ON_2dPoint & | |||
) |
set this vector to be perpendicular to a line defined by 2 points
bool ON_2dVector::PerpendicularTo | ( | const ON_2dVector & | ) |
set this vector to be perpendicular to another vector
void ON_2dVector::Reverse | ( | ) |
negate all coordinates
void ON_2dVector::Rotate | ( | double | angle | ) |
angle | angle in radians |
void ON_2dVector::Rotate | ( | double | sin_angle, |
double | cos_angle | ||
) |
sin_angle | sin(angle) |
cos_angle | cos(angle) |
void ON_2dVector::Set | ( | double | x, |
double | y | ||
) |
set 2d vector value
|
static |
Signed Angle (in radians) to A from B. A and B must be non-zero vectors. Returns -ON_PI <= angle <= ON_PI Note: The function is anti-symmetric, i.e Angle(A,B) = - Angle(A,B)
void ON_2dVector::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_2dVector::Unitize | ( | ) |
returns false if vector has zero length
ON_2dVector ON_2dVector::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), 1 returns (0,1) Returns: Unit 2d vector with vector[i] = (i==index)?1:0;
double ON_2dVector::WedgeProduct | ( | const ON_2dVector & | B | ) | const |
Signed area of the parallelogram. The volume element. returns x*B.y - y*B.x
void ON_2dVector::Zero | ( | ) |
set all coordinates to zero;
|
static |
(ON_DBL_QNAN,ON_DBL_QNAN)
|
static |
(ON_UNSET_VALUE,ON_UNSET_VALUE)
double ON_2dVector::x |
|
static |
(1.0,0.0)
double ON_2dVector::y |
|
static |
(0.0,1.0)
|
static |
(0.0,0.0)