Rosetta 3.3
Public Types | Public Member Functions | Friends
numeric::xyzVector< T > Class Template Reference

xyzVector: Fast (x,y,z)-coordinate numeric vector More...

#include <xyzVector.hh>

Collaboration diagram for numeric::xyzVector< T >:
Collaboration graph
[legend]

List of all members.

Public Types

typedefValue
typedef T & Reference
typedef T const & ConstReference
typedef T * Pointer
typedef T const * ConstPointer
typedefvalue_type
typedef T & reference
typedef T const & const_reference
typedef T * pointer
typedef T const * const_pointer
typedef void iterator_category
typedef void difference_type

Public Member Functions

 xyzVector ()
 Default constructor.
 xyzVector (xyzVector const &v)
 Copy constructor.
template<typename U >
 xyzVector (xyzVector< U > const &v)
 Copy constructor.
 xyzVector (Value const &t)
 Uniform value constructor.
 xyzVector (Value const &x_a, Value const &y_a, Value const &z_a)
 Triple value constructor.
template<typename U >
 xyzVector (U const *p)
 Pointer to contiguous values constructor.
 ~xyzVector ()
 Destructor.
xyzVectoroperator= (xyzVector const &v)
 Copy assignment.
template<typename U >
xyzVectoroperator= (xyzVector< U > const &v)
 Copy assignment.
template<typename U >
xyzVectoroperator= (U const *p)
 Assignment from pointer to contiguous values.
template<typename U >
xyzVectoroperator+= (xyzVector< U > const &v)
 += xyzVector
template<typename U >
xyzVectoroperator-= (xyzVector< U > const &v)
 -= xyzVector
template<typename U >
xyzVectorscaled_assign (Value const &t, xyzVector< U > const &v)
 Assign Value * xyzVector.
template<typename U >
xyzVectorscaled_add (Value const &t, xyzVector< U > const &v)
 Add Value * xyzVector.
template<typename U >
xyzVectorscaled_sub (Value const &t, xyzVector< U > const &v)
 Subtract Value * xyzVector.
xyzVectoroperator= (Value const &t)
 = Value
xyzVectoroperator+= (Value const &t)
 += Value
xyzVectoroperator-= (Value const &t)
 -= Value
xyzVectoroperator*= (Value const &t)
 *= Value
xyzVectoroperator/= (Value const &t)
 /= Value
xyzVectorassign (Value const &x_a, Value const &y_a, Value const &z_a)
 Triple value assignment.
xyzVectorclear ()
 Clear.
xyzVectorzero ()
 Zero.
xyzVectornegate ()
 Negate.
xyzVector operator- () const
 -xyzVector (negated copy)
xyzVector negated () const
 Negated copy.
void negated (xyzVector &a) const
 Negated: Return via argument (slightly faster)
xyzVectormin (xyzVector const &v)
 Set minimum coordinates wrt another xyzVector.
xyzVectormax (xyzVector const &v)
 Set maximum coordinates wrt another xyzVector.
xyzVectornormalize ()
 Normalize.
void normalized (xyzVector &a) const
 Normalized.
xyzVectornormalize_or_zero ()
 Normalize: zero xyzVector if length is zero.
void normalized_or_zero (xyzVector &a) const
 Normalized: zero xyzVector if length is zero.
xyzVectornormalize_any ()
 Normalize: arbitrary normalized xyzVector if length is zero.
void normalized_any (xyzVector &a) const
 Normalized: arbitrary normalized xyzVector if length is zero.
xyzVectornormalize (Value const &length_a)
 Normalize to a length.
void normalized (Value const &length_a, xyzVector &a) const
 Normalized to a length.
xyzVectornormalize_or_zero (Value const &length_a)
 Normalize to a length: zero xyzVector if length is zero.
void normalized_or_zero (Value const &length_a, xyzVector &a) const
 Normalized to a length: zero xyzVector if length is zero.
xyzVectornormalize_any (Value const &length_a)
 Normalize to a length: arbitrary normalized xyzVector if length is zero.
void normalized_any (Value const &length_a, xyzVector &a) const
 Normalized to a length: arbitrary normalized xyzVector if length is zero.
xyzVector normalized () const
 Normalized copy.
xyzVector normalized_or_zero () const
 Normalized copy: Zero xyzVector if length is zero.
xyzVector normalized_any () const
 Normalized copy: Arbitrary normalized xyzVector if length is zero.
xyzVector normalized (Value const &length_a) const
 Normalized to a length copy.
xyzVector normalized_or_zero (Value const &length_a) const
 Normalized to a length copy: Zero xyzVector if length is zero.
xyzVector normalized_any (Value const &length_a) const
 Normalized to a length copy: Arbitrary normalized xyzVector if length is zero.
xyzVectorproject_normal (xyzVector const &v)
 Project normal.
xyzVector projected_normal (xyzVector const &v) const
 Projected normal copy.
void projected_normal (xyzVector const &v, xyzVector &a) const
 Projected normal.
xyzVectorproject_parallel (xyzVector const &v)
 Project parallel.
xyzVector projected_parallel (xyzVector const &v) const
 Projected parallel copy.
void projected_parallel (xyzVector const &v, xyzVector &a)
 Projected parallel.
Value distance (xyzVector const &v) const
 Distance.
Value distance_squared (xyzVector const &v) const
 Distance squared.
Value dot (xyzVector const &v) const
 Dot product.
Value dot_product (xyzVector const &v) const
 Dot product.
Value inner_product (xyzVector const &v) const
 Inner product ( == dot product )
xyzVector cross (xyzVector const &v) const
 Cross product.
xyzVector cross_product (xyzVector const &v) const
 Cross product.
bool is_zero () const
 Is zero?
bool is_normalized () const
 Is exactly normalized?
bool is_normalized (Value const &tol) const
 Is normalized to within a tolerance?
bool is_unit () const
 Is exactly a unit vector?
bool is_unit (Value const &tol) const
 Is a unit vector to within a tolerance?
Value const & x () const
 Value x const.
Valuex ()
 Value x.
Value const & y () const
 Value y const.
Valuey ()
 Value y.
Value const & z () const
 Value z const.
Valuez ()
 Value z.
Value length () const
 Length.
Value length_squared () const
 Length squared.
Value norm () const
 Norm.
Value norm_squared () const
 Norm squared.
Value magnitude () const
 Magnitude.
Value magnitude_squared () const
 Magnitude squared.
void x (Value const &x_a)
 x assignment
void y (Value const &y_a)
 y assignment
void z (Value const &z_a)
 z assignment
Value const & operator[] (int const i) const
 xyzVector[ i ] const: 0-based index
Valueoperator[] (int const i)
 xyzVector[ i ]: 0-based index
Value const & operator() (int const i) const
 xyzVector( i ) const: 1-based index
Valueoperator() (int const i)
 xyzVector( i ): 1-based index
bool equal_length (xyzVector const &v)
 Equal length?
bool not_equal_length (xyzVector const &v)
 Not equal length?
bool longer (xyzVector const &v)
 Longer?
bool longer_or_equal (xyzVector const &v)
 Longer or equal length?
bool shorter (xyzVector const &v)
 Shorter?
bool shorter_or_equal (xyzVector const &v)
 Shorter or equal length?

Friends

class xyzVector
 Default constructor.
class xyzMatrix
xyzVector< T > operator* (xyzMatrix< T > const &m, xyzVector< T > const &v)
 xyzMatrix * xyzVector
xyzVector< T > product (xyzMatrix< T > const &m, xyzVector< T > const &v)
 xyzMatrix * xyzVector product
xyzVector< T > & inplace_product (xyzMatrix< T > const &m, xyzVector< T > &v)
 xyzMatrix * xyzVector in-place product
xyzVector< T > transpose_product (xyzMatrix< T > const &m, xyzVector< T > const &v)
 xyzMatrix^T * xyzVector product
xyzVector< T > & inplace_transpose_product (xyzMatrix< T > const &m, xyzVector< T > &v)
 xyzMatrix^T * xyzVector in-place transpose product
xyzMatrix< T > outer_product (xyzVector< T > const &a, xyzVector< T > const &b)
 xyzVector xyzVector outer product
xyzMatrix< T > projection_matrix (xyzVector< T > const &v)
 geometric center
xyzMatrix< T > rotation_matrix (xyzVector< T > const &axis, T const &theta)
 Rotation matrix for rotation about an axis by an angle in radians.
xyzVector operator+ (xyzVector const &a, xyzVector const &b)
 xyzVector + xyzVector
xyzVector operator+ (xyzVector const &v, Value const &t)
 xyzVector + Value
xyzVector operator+ (Value const &t, xyzVector const &v)
 Value + xyzVector.
xyzVector operator- (xyzVector const &a, xyzVector const &b)
 xyzVector - xyzVector
xyzVector operator- (xyzVector const &v, Value const &t)
 xyzVector - Value
xyzVector operator- (Value const &t, xyzVector const &v)
 Value - xyzVector.
xyzVector operator* (xyzVector const &v, Value const &t)
 xyzVector * Value
xyzVector operator* (Value const &t, xyzVector const &v)
 Value * xyzVector.
xyzVector operator/ (xyzVector const &v, Value const &t)
 xyzVector / Value
void add (xyzVector const &a, xyzVector const &b, xyzVector &r)
 Add: xyzVector + xyzVector.
void add (xyzVector const &v, Value const &t, xyzVector &r)
 Add: xyzVector + Value.
void add (Value const &t, xyzVector const &v, xyzVector &r)
 Add: Value + xyzVector.
void subtract (xyzVector const &a, xyzVector const &b, xyzVector &r)
 Subtract: xyzVector - xyzVector.
void subtract (xyzVector const &v, Value const &t, xyzVector &r)
 Subtract: xyzVector - Value.
void subtract (Value const &t, xyzVector const &v, xyzVector &r)
 Subtract: Value - xyzVector.
void multiply (xyzVector const &v, Value const &t, xyzVector &r)
 Multiply: xyzVector * Value.
void multiply (Value const &t, xyzVector const &v, xyzVector &r)
 Multiply: Value * xyzVector.
void divide (xyzVector const &v, Value const &t, xyzVector &r)
 Divide: xyzVector / Value.
xyzVector min (xyzVector const &a, xyzVector const &b)
 xyzVector with min coordinates of two xyzVectors
xyzVector max (xyzVector const &a, xyzVector const &b)
 xyzVector with max coordinates of two xyzVectors
Value distance (xyzVector const &a, xyzVector const &b)
 Distance.
Value distance_squared (xyzVector const &a, xyzVector const &b)
 Distance squared.
Value dot (xyzVector const &a, xyzVector const &b)
 Dot product.
Value dot_product (xyzVector const &a, xyzVector const &b)
 Dot product.
Value inner_product (xyzVector const &a, xyzVector const &b)
 Inner product ( == dot product )
xyzVector cross (xyzVector const &a, xyzVector const &b)
 Cross product.
xyzVector cross_product (xyzVector const &a, xyzVector const &b)
 Cross product.
void cross (xyzVector const &a, xyzVector const &b, xyzVector &c)
 Cross product: Return via argument (slightly faster)
void cross_product (xyzVector const &a, xyzVector const &b, xyzVector &c)
 Cross product: Return via argument (slightly faster)
xyzVector midpoint (xyzVector const &a, xyzVector const &b)
 Midpoint of 2 xyzVectors.
void midpoint (xyzVector const &a, xyzVector const &b, xyzVector &m)
 Midpoint of 2 xyzVectors: Return via argument (slightly faster)
xyzVector center (xyzVector const &a, xyzVector const &b)
 Center of 2 xyzVectors.
void center (xyzVector const &a, xyzVector const &b, xyzVector &m)
 Center of 2 xyzVectors: Return via argument (slightly faster)
xyzVector center (xyzVector const &a, xyzVector const &b, xyzVector const &c)
 Center of 3 xyzVectors.
void center (xyzVector const &a, xyzVector const &b, xyzVector const &c, xyzVector &m)
 Center of 3 xyzVectors: Return via argument (slightly faster)
xyzVector center (xyzVector const &a, xyzVector const &b, xyzVector const &c, xyzVector const &d)
 Center of 4 xyzVectors.
void center (xyzVector const &a, xyzVector const &b, xyzVector const &c, xyzVector const &d, xyzVector &m)
 Center of 4 xyzVectors: Return via argument (slightly faster)
Value angle_of (xyzVector const &a, xyzVector const &b)
 Angle between two vectors (in radians on [ 0, pi ])
Value angle_of (xyzVector const &a, xyzVector const &b, xyzVector const &c)
 Angle formed by three consecutive points (in radians on [ 0, pi ])
Value cos_of (xyzVector const &a, xyzVector const &b)
 Cosine of angle between two vectors.
Value cos_of (xyzVector const &a, xyzVector const &b, xyzVector const &c)
 Cosine of angle formed by three consecutive points.
Value sin_of (xyzVector const &a, xyzVector const &b)
 Sine of angle between two vectors.
Value sin_of (xyzVector const &a, xyzVector const &b, xyzVector const &c)
 Sine of angle formed by three consecutive points.
bool operator== (xyzVector const &a, xyzVector const &b)
 xyzVector == xyzVector
bool operator!= (xyzVector const &a, xyzVector const &b)
 xyzVector != xyzVector
bool operator< (xyzVector const &a, xyzVector const &b)
 xyzVector < xyzVector
bool operator<= (xyzVector const &a, xyzVector const &b)
 xyzVector <= xyzVector
bool operator>= (xyzVector const &a, xyzVector const &b)
 xyzVector >= xyzVector
bool operator> (xyzVector const &a, xyzVector const &b)
 xyzVector > xyzVector
bool operator== (xyzVector const &v, Value const &t)
 xyzVector == Value
bool operator!= (xyzVector const &v, Value const &t)
 xyzVector != Value
bool operator< (xyzVector const &v, Value const &t)
 xyzVector < Value
bool operator<= (xyzVector const &v, Value const &t)
 xyzVector <= Value
bool operator>= (xyzVector const &v, Value const &t)
 xyzVector >= Value
bool operator> (xyzVector const &v, Value const &t)
 xyzVector > Value
bool operator== (Value const &t, xyzVector const &v)
 Value == xyzVector.
bool operator!= (Value const &t, xyzVector const &v)
 Value != xyzVector.
bool operator< (Value const &t, xyzVector const &v)
 Value < xyzVector.
bool operator<= (Value const &t, xyzVector const &v)
 Value <= xyzVector.
bool operator>= (Value const &t, xyzVector const &v)
 Value >= xyzVector.
bool operator> (Value const &t, xyzVector const &v)
 Value > xyzVector.
bool equal_length (xyzVector const &a, xyzVector const &b)
 Equal length?
bool not_equal_length (xyzVector const &a, xyzVector const &b)
 Not equal length?

Detailed Description

template<typename T>
class numeric::xyzVector< T >

xyzVector: Fast (x,y,z)-coordinate numeric vector

xyzVector is a fast 3 coordinate ( x, y, z ) vector template class. Functions are inlined and loop-free for optimal speed. The destructor is declared non-virtual for speed so xyzVector is not set up for use as a base class. As a template class, xyzVector can hold various value types.

Forward declarations and typedefs for common value types are provided in the file xyzVector.fwd.hh. This header should be included in files that only use the names of the xyzVector types (e.g., function declarations and functions that just pass the types through to other functions by pointer or reference).

Common operations that are normally coded in loops are provided and include:

normalize()

normalize_or_zero() - Zero xyzVector if length is zero

normalize_any() - Arbitrary normalized xyzVector if length is zero

project_normal() - Project normally onto input xyzVector

project_parallel() - Project in direction of input xyzVector

distance() - Distance between two xyzVectors

distance_squared() - Distance squared between two xyzVectors

dot(), dot_product(), inner_product() - dot or inner product of two xyzVectors

cross(), cross_product() - cross product of two xyzVectors

midpoint() - midpoint between two xyzVectors.

Many operations also have 'ed' versions; e.g., normalize() and normalized() which do not modify the xyzVector, but generates an xyzVector.

Additionally, the header xyz_functions.hh contains common functions that interact with xyzVector such as:

product() - xyzMatrix xyzVector product

inplace_product() - xyzMatrix xyzVector product, input xyzVector is modified

outer_product() - xyzVector xyzVector outer product

projection_matrix() - projection matrix onto the line through an xyzVector

dihedral() - dihedral (torsion) angle with respect to four positions in a chain

rotation_matrix() - rotation matrix about a helical axis through the origin through an angle

rotation_axis() - transformation from rotation matrix to helical axis of rotation

eigenvalue_jacobi() - classic Jacobi algorithm for the eigenvalues of a real symmetric matrix

eigenvector_jacobi() - classic Jacobi algorithm for the eigenvalues and eigenvectors of a real symmetric matrix


Member Typedef Documentation

template<typename T>
typedef T const* numeric::xyzVector< T >::const_pointer
template<typename T>
typedef T const& numeric::xyzVector< T >::const_reference
template<typename T>
typedef T const* numeric::xyzVector< T >::ConstPointer
template<typename T>
typedef T const& numeric::xyzVector< T >::ConstReference
template<typename T>
typedef void numeric::xyzVector< T >::difference_type
template<typename T>
typedef void numeric::xyzVector< T >::iterator_category
template<typename T>
typedef T* numeric::xyzVector< T >::pointer
template<typename T>
typedef T* numeric::xyzVector< T >::Pointer
template<typename T>
typedef T& numeric::xyzVector< T >::reference
template<typename T>
typedef T& numeric::xyzVector< T >::Reference
template<typename T>
numeric::xyzVector< T >::Value

typedef T Value;

template<typename T>
typedef T numeric::xyzVector< T >::value_type

Constructor & Destructor Documentation

template<typename T>
numeric::xyzVector< T >::xyzVector ( ) [inline]
template<typename T>
numeric::xyzVector< T >::xyzVector ( xyzVector< T > const &  v) [inline]

Copy constructor.

template<typename T>
template<typename U >
numeric::xyzVector< T >::xyzVector ( xyzVector< U > const &  v) [inline]

Copy constructor.

template<typename T>
numeric::xyzVector< T >::xyzVector ( Value const &  t) [inline, explicit]

Uniform value constructor.

template<typename T>
numeric::xyzVector< T >::xyzVector ( Value const &  x_a,
Value const &  y_a,
Value const &  z_a 
) [inline]

Triple value constructor.

template<typename T>
template<typename U >
numeric::xyzVector< T >::xyzVector ( U const *  p) [inline, explicit]

Pointer to contiguous values constructor.

Note:
U must be assignable to a Value
Warning:
No way to check that argument points to three values
Argument missing an & operator will quietly call the uniform value constructor
Note:
U must be assignable to a Value
Warning:
Danger! No way to check that argument points to three values
Danger! Argument missing an & operator will quietly call the uniform value constructor
template<typename T>
numeric::xyzVector< T >::~xyzVector ( ) [inline]

Destructor.


Member Function Documentation

template<typename T>
numeric::xyzVector< T >::assign ( Value const &  x_a,
Value const &  y_a,
Value const &  z_a 
) [inline]

Triple value assignment.

Parameters:
[in]x_ax-coordinate
[in]y_ay-coordinate
[in]z_az-coordinate
Returns:
Reference to the xyzVector
template<typename T>
xyzVector& numeric::xyzVector< T >::clear ( ) [inline]

Clear.

template<typename T>
xyzVector numeric::xyzVector< T >::cross ( xyzVector< T > const &  v) const [inline]
template<typename T>
xyzVector numeric::xyzVector< T >::cross_product ( xyzVector< T > const &  v) const [inline]

Cross product.

References numeric::xyzVector< T >::xyzVector().

template<typename T>
Value numeric::xyzVector< T >::distance ( xyzVector< T > const &  v) const [inline]

Distance.

References numeric::square().

template<typename T>
Value numeric::xyzVector< T >::distance_squared ( xyzVector< T > const &  v) const [inline]
template<typename T>
Value numeric::xyzVector< T >::dot ( xyzVector< T > const &  v) const [inline]
template<typename T>
Value numeric::xyzVector< T >::dot_product ( xyzVector< T > const &  v) const [inline]

Dot product.

template<typename T>
bool numeric::xyzVector< T >::equal_length ( xyzVector< T > const &  v) [inline]

Equal length?

References numeric::xyzVector< T >::length_squared().

template<typename T>
Value numeric::xyzVector< T >::inner_product ( xyzVector< T > const &  v) const [inline]

Inner product ( == dot product )

template<typename T>
bool numeric::xyzVector< T >::is_normalized ( ) const [inline]

Is exactly normalized?

References numeric::xyzVector< T >::length_squared().

template<typename T>
bool numeric::xyzVector< T >::is_normalized ( Value const &  tol) const [inline]

Is normalized to within a tolerance?

References numeric::xyzVector< T >::length_squared(), and loops_kic::tol.

template<typename T>
bool numeric::xyzVector< T >::is_unit ( ) const [inline]

Is exactly a unit vector?

References numeric::xyzVector< T >::length_squared().

template<typename T>
bool numeric::xyzVector< T >::is_unit ( Value const &  tol) const [inline]

Is a unit vector to within a tolerance?

References numeric::xyzVector< T >::length_squared(), and loops_kic::tol.

template<typename T>
bool numeric::xyzVector< T >::is_zero ( ) const [inline]

Is zero?

template<typename T>
Value numeric::xyzVector< T >::length ( ) const [inline]
template<typename T>
Value numeric::xyzVector< T >::length_squared ( ) const [inline]
template<typename T>
bool numeric::xyzVector< T >::longer ( xyzVector< T > const &  v) [inline]
template<typename T>
bool numeric::xyzVector< T >::longer_or_equal ( xyzVector< T > const &  v) [inline]

Longer or equal length?

References numeric::xyzVector< T >::length_squared().

template<typename T>
Value numeric::xyzVector< T >::magnitude ( ) const [inline]

Magnitude.

template<typename T>
Value numeric::xyzVector< T >::magnitude_squared ( ) const [inline]

Magnitude squared.

template<typename T>
xyzVector& numeric::xyzVector< T >::max ( xyzVector< T > const &  v) [inline]

Set maximum coordinates wrt another xyzVector.

template<typename T>
xyzVector& numeric::xyzVector< T >::min ( xyzVector< T > const &  v) [inline]

Set minimum coordinates wrt another xyzVector.

template<typename T>
numeric::xyzVector< T >::negate ( ) [inline]

Negate.

Returns:
Additive inverse of the (modified) xyzVector
template<typename T>
numeric::xyzVector< T >::negated ( ) const [inline]

Negated copy.

References numeric::xyzVector< T >::xyzVector().

template<typename T>
numeric::xyzVector< T >::negated ( xyzVector< T > &  a) const [inline]

Negated: Return via argument (slightly faster)

Negated.

Parameters:
[out]aAdditive inverse of the (unmodified) xyzVector
Returns:
None
template<typename T>
Value numeric::xyzVector< T >::norm ( ) const [inline]

Norm.

template<typename T>
Value numeric::xyzVector< T >::norm_squared ( ) const [inline]

Norm squared.

template<typename T>
numeric::xyzVector< T >::normalize ( ) [inline]
template<typename T>
xyzVector& numeric::xyzVector< T >::normalize ( Value const &  length_a) [inline]

Normalize to a length.

References numeric::xyzVector< T >::length().

template<typename T>
xyzVector& numeric::xyzVector< T >::normalize_any ( Value const &  length_a) [inline]

Normalize to a length: arbitrary normalized xyzVector if length is zero.

References numeric::xyzVector< T >::length().

template<typename T>
numeric::xyzVector< T >::normalize_any ( ) [inline]

Normalize: arbitrary normalized xyzVector if length is zero.

Normalize: arbitrary normalized xyzVector, if length is zero.

Returns:
The (modified) xyzVector, normalized; arbitrary normalized xyzVector, if length is zero

References numeric::xyzVector< T >::length().

template<typename T>
numeric::xyzVector< T >::normalize_or_zero ( ) [inline]

Normalize: zero xyzVector if length is zero.

Normalize: zero xyzVector, if length is zero.

Returns:
The (modified) xyzVector, normalized; zero xyzVector, if length is zero

References numeric::xyzVector< T >::length().

template<typename T>
xyzVector& numeric::xyzVector< T >::normalize_or_zero ( Value const &  length_a) [inline]

Normalize to a length: zero xyzVector if length is zero.

References numeric::xyzVector< T >::length().

template<typename T>
numeric::xyzVector< T >::normalized ( ) const [inline]
template<typename T>
xyzVector numeric::xyzVector< T >::normalized ( Value const &  length_a) const [inline]

Normalized to a length copy.

References numeric::xyzVector< T >::length(), and numeric::xyzVector< T >::xyzVector().

template<typename T>
numeric::xyzVector< T >::normalized ( xyzVector< T > &  a) const [inline]

Normalized.

Parameters:
[out]aThe (unmodified) xyzVector, normalized
Returns:
None

References numeric::xyzVector< T >::length().

Referenced by numeric::rotation_matrix().

template<typename T>
void numeric::xyzVector< T >::normalized ( Value const &  length_a,
xyzVector< T > &  a 
) const [inline]

Normalized to a length.

References numeric::xyzVector< T >::length().

template<typename T>
void numeric::xyzVector< T >::normalized_any ( Value const &  length_a,
xyzVector< T > &  a 
) const [inline]

Normalized to a length: arbitrary normalized xyzVector if length is zero.

References numeric::xyzVector< T >::length().

template<typename T>
numeric::xyzVector< T >::normalized_any ( ) const [inline]

Normalized copy: Arbitrary normalized xyzVector if length is zero.

References numeric::xyzVector< T >::length(), and numeric::xyzVector< T >::xyzVector().

template<typename T>
xyzVector numeric::xyzVector< T >::normalized_any ( Value const &  length_a) const [inline]

Normalized to a length copy: Arbitrary normalized xyzVector if length is zero.

References numeric::xyzVector< T >::length(), and numeric::xyzVector< T >::xyzVector().

template<typename T>
numeric::xyzVector< T >::normalized_any ( xyzVector< T > &  a) const [inline]

Normalized: arbitrary normalized xyzVector if length is zero.

Normalized: arbitrary normalized xyzVector, if length is zero.

Parameters:
[out]aThe (unmodified) xyzVector, normalized; arbitrary normalized xyzVector, if length is zero
Returns:
None

References numeric::xyzVector< T >::length().

template<typename T>
void numeric::xyzVector< T >::normalized_or_zero ( Value const &  length_a,
xyzVector< T > &  a 
) const [inline]

Normalized to a length: zero xyzVector if length is zero.

References numeric::xyzVector< T >::length().

template<typename T>
numeric::xyzVector< T >::normalized_or_zero ( ) const [inline]

Normalized copy: Zero xyzVector if length is zero.

References numeric::xyzVector< T >::length(), and numeric::xyzVector< T >::xyzVector().

template<typename T>
xyzVector numeric::xyzVector< T >::normalized_or_zero ( Value const &  length_a) const [inline]

Normalized to a length copy: Zero xyzVector if length is zero.

References numeric::xyzVector< T >::length(), and numeric::xyzVector< T >::xyzVector().

template<typename T>
numeric::xyzVector< T >::normalized_or_zero ( xyzVector< T > &  a) const [inline]

Normalized: zero xyzVector if length is zero.

Normalized: zero xyzVector, if length is zero.

Parameters:
[out]aThe (unmodified) xyzVector, normalized; zero xyzVector, if length is zero
Returns:
None

References numeric::xyzVector< T >::length().

template<typename T>
bool numeric::xyzVector< T >::not_equal_length ( xyzVector< T > const &  v) [inline]

Not equal length?

References numeric::xyzVector< T >::length_squared().

template<typename T>
Value const& numeric::xyzVector< T >::operator() ( int const  i) const [inline]

xyzVector( i ) const: 1-based index

template<typename T>
Value& numeric::xyzVector< T >::operator() ( int const  i) [inline]

xyzVector( i ): 1-based index

template<typename T>
numeric::xyzVector< T >::operator*= ( Value const &  t) [inline]

*= Value

Parameters:
[in]tscalar by which to multiply each coordinate of the xyzVector
Returns:
Reference to the xyzVector

References sd::t.

template<typename T>
numeric::xyzVector< T >::operator+= ( Value const &  t) [inline]

+= Value

Parameters:
[in]tscalar to add to each coordinate
Returns:
Reference to the xyzVector

References sd::t.

template<typename T>
template<typename U >
numeric::xyzVector< T >::operator+= ( xyzVector< U > const &  v) [inline]

+= xyzVector

Parameters:
[in]vxyzVector to add to the xyzVector
Returns:
Reference to the xyzVector
template<typename T>
xyzVector numeric::xyzVector< T >::operator- ( ) const [inline]

-xyzVector (negated copy)

References numeric::xyzVector< T >::xyzVector().

template<typename T>
template<typename U >
numeric::xyzVector< T >::operator-= ( xyzVector< U > const &  v) [inline]

-= xyzVector

Parameters:
[in]vxyzVector to subtract from the xyzVector
Returns:
Reference to the xyzVector
template<typename T>
numeric::xyzVector< T >::operator-= ( Value const &  t) [inline]

-= Value

Parameters:
[in]tscalar to subtract from each coordinate
Returns:
Reference to the xyzVector

References sd::t.

template<typename T>
numeric::xyzVector< T >::operator/= ( Value const &  t) [inline]

/= Value

Parameters:
[in]tscalar by which to divide each coordinate of the xyzVector
Returns:
Reference to the xyzVector
template<typename T>
template<typename U >
numeric::xyzVector< T >::operator= ( xyzVector< U > const &  v) [inline]

Copy assignment.

Parameters:
[in]vxyzVector to assign to the xyzVector
Returns:
Reference to the xyzVector
template<typename T>
numeric::xyzVector< T >::operator= ( Value const &  t) [inline]

= Value

Parameters:
[in]tscalar to assign to each coordinate
Returns:
Reference to the xyzVector

References sd::t.

template<typename T>
numeric::xyzVector< T >::operator= ( xyzVector< T > const &  v) [inline]

Copy assignment.

Parameters:
[in]vxyzVector to assign to the xyzVector
Returns:
Reference to the xyzVector
template<typename T>
template<typename U >
numeric::xyzVector< T >::operator= ( U const *  p) [inline]

Assignment from pointer to contiguous values.

Warning:
No way to check that argument points to three values
Danger! No way to check that argument points to three values
Parameters:
[in]ppointer to first of three contiguous values
Returns:
Reference to the xyzVector

References docking::p.

template<typename T>
Value const& numeric::xyzVector< T >::operator[] ( int const  i) const [inline]

xyzVector[ i ] const: 0-based index

template<typename T>
Value& numeric::xyzVector< T >::operator[] ( int const  i) [inline]

xyzVector[ i ]: 0-based index

template<typename T>
numeric::xyzVector< T >::project_normal ( xyzVector< T > const &  v) [inline]

Project normal.

Note:
This vector projected normally onto input vector
Not meaningful when v == 0
Parameters:
[in]vInput xyzVector upon which this xyzVector is projected normally
Note:
This vector projected normally onto input vector v
Not meaningful when v == 0
Returns:
The (modified) xyzVector, projected normally onto v

References numeric::xyzVector< T >::dot(), and numeric::xyzVector< T >::length_squared().

template<typename T>
numeric::xyzVector< T >::project_parallel ( xyzVector< T > const &  v) [inline]

Project parallel.

Note:
This vector projected in direction of input vector
Not meaningful when v == 0
Parameters:
[in]vInput xyzVector in the direction of which this xyzVector is projected
Note:
This vector projected in direction of input vector v
Not meaningful when v == 0
Returns:
The (modified) xyzVector, in the direction of v

References numeric::xyzVector< T >::dot(), and numeric::xyzVector< T >::length_squared().

template<typename T>
numeric::xyzVector< T >::projected_normal ( xyzVector< T > const &  v) const [inline]

Projected normal copy.

Note:
Copy of this vector projected normally onto input vector
Not meaningful when v == 0

References numeric::xyzVector< T >::dot(), numeric::xyzVector< T >::length_squared(), and numeric::xyzVector< T >::xyzVector().

template<typename T>
numeric::xyzVector< T >::projected_normal ( xyzVector< T > const &  v,
xyzVector< T > &  a 
) const [inline]

Projected normal.

Note:
Copy of this vector projected normally onto first input vector
Not meaningful when v == 0
Parameters:
[in]vInput xyzVector upon which this xyzVector is projected normally
[out]aThe (unmodified) xyzVector, projected normally onto the input xyzVector v
Note:
Copy of this vector projected normally onto v
Not meaningful when v == 0
Returns:
None

References numeric::xyzVector< T >::dot(), and numeric::xyzVector< T >::length_squared().

template<typename T>
numeric::xyzVector< T >::projected_parallel ( xyzVector< T > const &  v) const [inline]

Projected parallel copy.

Note:
Copy of this vector projected in direction of input vector
Not meaningful when v == 0

References numeric::xyzVector< T >::dot(), numeric::xyzVector< T >::length_squared(), and numeric::xyzVector< T >::xyzVector().

template<typename T>
numeric::xyzVector< T >::projected_parallel ( xyzVector< T > const &  v,
xyzVector< T > &  a 
) [inline]

Projected parallel.

Note:
Copy of this vector projected in direction of first input vector
Not meaningful when v == 0
Parameters:
[in]vInput xyzVector in the direction of which this xyzVector is projected
[out]aThe (unmodified) xyzVector, projected in the direction of the input xyzVector v
Note:
Copy of this vector projected in direction of input vector v
Not meaningful when v == 0
Returns:
None

References numeric::xyzVector< T >::dot(), and numeric::xyzVector< T >::length_squared().

template<typename T>
template<typename U >
xyzVector& numeric::xyzVector< T >::scaled_add ( Value const &  t,
xyzVector< U > const &  v 
) [inline]

Add Value * xyzVector.

Note:
Avoids temporary of += Value * xyzVector
template<typename T>
template<typename U >
xyzVector& numeric::xyzVector< T >::scaled_assign ( Value const &  t,
xyzVector< U > const &  v 
) [inline]

Assign Value * xyzVector.

Note:
Avoids temporary of = Value * xyzVector
template<typename T>
template<typename U >
xyzVector& numeric::xyzVector< T >::scaled_sub ( Value const &  t,
xyzVector< U > const &  v 
) [inline]

Subtract Value * xyzVector.

Note:
Avoids temporary of -= Value * xyzVector
template<typename T>
bool numeric::xyzVector< T >::shorter ( xyzVector< T > const &  v) [inline]
template<typename T>
bool numeric::xyzVector< T >::shorter_or_equal ( xyzVector< T > const &  v) [inline]

Shorter or equal length?

References numeric::xyzVector< T >::length_squared().

template<typename T>
Value& numeric::xyzVector< T >::x ( ) [inline]

Value x.

template<typename T>
void numeric::xyzVector< T >::x ( Value const &  x_a) [inline]

x assignment

template<typename T>
Value const& numeric::xyzVector< T >::x ( ) const [inline]
template<typename T>
Value& numeric::xyzVector< T >::y ( ) [inline]

Value y.

template<typename T>
void numeric::xyzVector< T >::y ( Value const &  y_a) [inline]

y assignment

template<typename T>
Value const& numeric::xyzVector< T >::y ( ) const [inline]
template<typename T>
Value& numeric::xyzVector< T >::z ( ) [inline]

Value z.

template<typename T>
Value const& numeric::xyzVector< T >::z ( ) const [inline]
template<typename T>
void numeric::xyzVector< T >::z ( Value const &  z_a) [inline]

z assignment

template<typename T>
xyzVector& numeric::xyzVector< T >::zero ( ) [inline]

Zero.


Friends And Related Function Documentation

template<typename T>
void add ( xyzVector< T > const &  a,
xyzVector< T > const &  b,
xyzVector< T > &  r 
) [friend]
template<typename T>
void add ( xyzVector< T > const &  v,
Value const &  t,
xyzVector< T > &  r 
) [friend]

Add: xyzVector + Value.

template<typename T>
void add ( Value const &  t,
xyzVector< T > const &  v,
xyzVector< T > &  r 
) [friend]

Add: Value + xyzVector.

template<typename T>
Value angle_of ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]

Angle between two vectors (in radians on [ 0, pi ])

Referenced by numeric::angle_of().

template<typename T>
Value angle_of ( xyzVector< T > const &  a,
xyzVector< T > const &  b,
xyzVector< T > const &  c 
) [friend]

Angle formed by three consecutive points (in radians on [ 0, pi ])

Note:
For points a, b, c, the angle is the angle between the vectors a - b and c - b in other words, the positive angle about b from a to c
template<typename T>
xyzVector center ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]

Center of 2 xyzVectors.

template<typename T>
void center ( xyzVector< T > const &  a,
xyzVector< T > const &  b,
xyzVector< T > &  m 
) [friend]

Center of 2 xyzVectors: Return via argument (slightly faster)

template<typename T>
xyzVector center ( xyzVector< T > const &  a,
xyzVector< T > const &  b,
xyzVector< T > const &  c 
) [friend]

Center of 3 xyzVectors.

template<typename T>
void center ( xyzVector< T > const &  a,
xyzVector< T > const &  b,
xyzVector< T > const &  c,
xyzVector< T > &  m 
) [friend]

Center of 3 xyzVectors: Return via argument (slightly faster)

template<typename T>
xyzVector center ( xyzVector< T > const &  a,
xyzVector< T > const &  b,
xyzVector< T > const &  c,
xyzVector< T > const &  d 
) [friend]

Center of 4 xyzVectors.

template<typename T>
void center ( xyzVector< T > const &  a,
xyzVector< T > const &  b,
xyzVector< T > const &  c,
xyzVector< T > const &  d,
xyzVector< T > &  m 
) [friend]

Center of 4 xyzVectors: Return via argument (slightly faster)

template<typename T>
Value cos_of ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]

Cosine of angle between two vectors.

Referenced by numeric::cos_of(), and numeric::sin_of().

template<typename T>
Value cos_of ( xyzVector< T > const &  a,
xyzVector< T > const &  b,
xyzVector< T > const &  c 
) [friend]

Cosine of angle formed by three consecutive points.

Note:
For points a, b, c, the angle is the angle between the vectors a - b and c - b in other words, the positive angle about b from a to c.
template<typename T>
xyzVector cross ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]

Cross product.

template<typename T>
void cross ( xyzVector< T > const &  a,
xyzVector< T > const &  b,
xyzVector< T > &  c 
) [friend]

Cross product: Return via argument (slightly faster)

template<typename T>
xyzVector cross_product ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]

Cross product.

template<typename T>
void cross_product ( xyzVector< T > const &  a,
xyzVector< T > const &  b,
xyzVector< T > &  c 
) [friend]

Cross product: Return via argument (slightly faster)

template<typename T>
Value distance ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]

Distance.

template<typename T>
Value distance_squared ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]

Distance squared.

template<typename T>
void divide ( xyzVector< T > const &  v,
Value const &  t,
xyzVector< T > &  r 
) [friend]

Divide: xyzVector / Value.

template<typename T>
Value dot ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]

Dot product.

template<typename T>
Value dot_product ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]

Dot product.

template<typename T>
bool equal_length ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]

Equal length?

template<typename T>
Value inner_product ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]

Inner product ( == dot product )

template<typename T>
xyzVector< T >& inplace_product ( xyzMatrix< T > const &  m,
xyzVector< T > &  v 
) [friend]

xyzMatrix * xyzVector in-place product

Note:
Input xyzVector is modified
template<typename T>
xyzVector< T >& inplace_transpose_product ( xyzMatrix< T > const &  m,
xyzVector< T > &  v 
) [friend]

xyzMatrix^T * xyzVector in-place transpose product

Note:
Input xyzVector is modified
template<typename T>
xyzVector max ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]

xyzVector with max coordinates of two xyzVectors

template<typename T>
void midpoint ( xyzVector< T > const &  a,
xyzVector< T > const &  b,
xyzVector< T > &  m 
) [friend]

Midpoint of 2 xyzVectors: Return via argument (slightly faster)

template<typename T>
xyzVector midpoint ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]

Midpoint of 2 xyzVectors.

template<typename T>
xyzVector min ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]

xyzVector with min coordinates of two xyzVectors

template<typename T>
void multiply ( xyzVector< T > const &  v,
Value const &  t,
xyzVector< T > &  r 
) [friend]

Multiply: xyzVector * Value.

template<typename T>
void multiply ( Value const &  t,
xyzVector< T > const &  v,
xyzVector< T > &  r 
) [friend]

Multiply: Value * xyzVector.

template<typename T>
bool not_equal_length ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]

Not equal length?

template<typename T>
bool operator!= ( Value const &  t,
xyzVector< T > const &  v 
) [friend]

Value != xyzVector.

template<typename T>
bool operator!= ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]
template<typename T>
bool operator!= ( xyzVector< T > const &  v,
Value const &  t 
) [friend]

xyzVector != Value

template<typename T>
xyzVector operator* ( xyzVector< T > const &  v,
Value const &  t 
) [friend]

xyzVector * Value

template<typename T>
xyzVector operator* ( Value const &  t,
xyzVector< T > const &  v 
) [friend]

Value * xyzVector.

template<typename T>
xyzVector< T > operator* ( xyzMatrix< T > const &  m,
xyzVector< T > const &  v 
) [friend]

xyzMatrix * xyzVector

Note:
Same as product( xyzMatrix, xyzVector )
template<typename T>
xyzVector operator+ ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]
template<typename T>
xyzVector operator+ ( Value const &  t,
xyzVector< T > const &  v 
) [friend]

Value + xyzVector.

template<typename T>
xyzVector operator+ ( xyzVector< T > const &  v,
Value const &  t 
) [friend]

xyzVector + Value

template<typename T>
xyzVector operator- ( xyzVector< T > const &  v,
Value const &  t 
) [friend]

xyzVector - Value

template<typename T>
xyzVector operator- ( Value const &  t,
xyzVector< T > const &  v 
) [friend]

Value - xyzVector.

template<typename T>
xyzVector operator- ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]
template<typename T>
xyzVector operator/ ( xyzVector< T > const &  v,
Value const &  t 
) [friend]

xyzVector / Value

template<typename T>
bool operator< ( Value const &  t,
xyzVector< T > const &  v 
) [friend]

Value < xyzVector.

template<typename T>
bool operator< ( xyzVector< T > const &  v,
Value const &  t 
) [friend]

xyzVector < Value

template<typename T>
bool operator< ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]
template<typename T>
bool operator<= ( Value const &  t,
xyzVector< T > const &  v 
) [friend]

Value <= xyzVector.

template<typename T>
bool operator<= ( xyzVector< T > const &  v,
Value const &  t 
) [friend]

xyzVector <= Value

template<typename T>
bool operator<= ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]
template<typename T>
bool operator== ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]
template<typename T>
bool operator== ( xyzVector< T > const &  v,
Value const &  t 
) [friend]

xyzVector == Value

template<typename T>
bool operator== ( Value const &  t,
xyzVector< T > const &  v 
) [friend]

Value == xyzVector.

template<typename T>
bool operator> ( xyzVector< T > const &  v,
Value const &  t 
) [friend]

xyzVector > Value

template<typename T>
bool operator> ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]
template<typename T>
bool operator> ( Value const &  t,
xyzVector< T > const &  v 
) [friend]

Value > xyzVector.

template<typename T>
bool operator>= ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]
template<typename T>
bool operator>= ( Value const &  t,
xyzVector< T > const &  v 
) [friend]

Value >= xyzVector.

template<typename T>
bool operator>= ( xyzVector< T > const &  v,
Value const &  t 
) [friend]

xyzVector >= Value

template<typename T>
xyzMatrix< T > outer_product ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]

xyzVector xyzVector outer product

template<typename T>
xyzVector< T > product ( xyzMatrix< T > const &  m,
xyzVector< T > const &  v 
) [friend]

xyzMatrix * xyzVector product

Note:
Same as xyzMatrix * xyzVector
template<typename T>
xyzMatrix< T > projection_matrix ( xyzVector< T > const &  v) [friend]

geometric center

Note:
compute the geometric center of a list of points Projection matrix onto the line through a vector
template<typename T>
xyzMatrix< T > rotation_matrix ( xyzVector< T > const &  axis,
T const &  theta 
) [friend]

Rotation matrix for rotation about an axis by an angle in radians.

template<typename T>
Value sin_of ( xyzVector< T > const &  a,
xyzVector< T > const &  b 
) [friend]

Sine of angle between two vectors.

Referenced by numeric::sin_of().

template<typename T>
Value sin_of ( xyzVector< T > const &  a,
xyzVector< T > const &  b,
xyzVector< T > const &  c 
) [friend]

Sine of angle formed by three consecutive points.

Note:
For points a, b, c, the angle is the angle between the vectors a - b and c - b in other words, the positive angle about b from a to c
template<typename T>
void subtract ( Value const &  t,
xyzVector< T > const &  v,
xyzVector< T > &  r 
) [friend]

Subtract: Value - xyzVector.

template<typename T>
void subtract ( xyzVector< T > const &  a,
xyzVector< T > const &  b,
xyzVector< T > &  r 
) [friend]

Subtract: xyzVector - xyzVector.

template<typename T>
void subtract ( xyzVector< T > const &  v,
Value const &  t,
xyzVector< T > &  r 
) [friend]

Subtract: xyzVector - Value.

template<typename T>
xyzVector< T > transpose_product ( xyzMatrix< T > const &  m,
xyzVector< T > const &  v 
) [friend]

xyzMatrix^T * xyzVector product

template<typename T>
friend class xyzMatrix [friend]
template<typename T>
numeric::xyzVector< T >::xyzVector [friend]

Default constructor.

Note:
Values are uninitialized for efficiency

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines