Web Analytics Made Easy - Statcounter
Skip to content

Class SBDTypePhysicalVector3#

template <typename Quantity>

ClassList > SBDTypePhysicalVector3

This template class is used to represent three-dimensional physical vectors. More...

  • #include <SBDTypePhysicalVector3.hpp>

Public Attributes#

Type Name
Quantity v
The components of the physical vector.

Public Static Attributes#

Type Name
const SBDTypePhysicalVector3< Quantity > one
The one physical vector, with all components equal to one.
const SBDTypePhysicalVector3< Quantity > zero
The zero physical vector.

Public Functions#

Type Name
SBDTypePhysicalVector3 ()
Constructs the physical vector [ 0 0 0 ].
SBDTypePhysicalVector3 (const Quantity & x)
Constructs the physical vector [ x x x ].
SBDTypePhysicalVector3 (const Quantity & x, const Quantity & y, const Quantity & z)
Constructs the physical vector [ x y z ].
SBDTypePhysicalVector3 (Quantity u)
Constructs the physical vector [ v [0]v [1]v [2] ].
SBDTypePhysicalVector3 (double x)
Constructs a dimensionless physical vector with all components set to x .
SBDTypePhysicalVector3 (double x, double y, double z)
Constructs the dimensionless physical vector [ x y z ].
SBDTypePhysicalVector3 (double u)
Constructs the dimensionless physical vector [ v [0]v [1]v [2] ].
SBDTypePhysicalVector3 (const SBDTypePhysicalVector3< Quantity > & u)
Copy constructor.
SBDTypePhysicalVector3< SBQuantity::dimensionless > getValue () const
Returns a dimensionless physical vector whose components are equal to those of this physical vector.
void getValue (double * array) const
Stores the components as doubles in array [0],array [1] andarray [2].
void getValue (float * array) const
Stores the components as floats in array [0],array [1] andarray [2].
Quantity norm () const
Returns the norm of this physical vector.
SBQuantityType< typename SBDQuantityUnitMultiplication< typename Quantity::UnitType, typename Quantity::UnitType >::UnitType > norm2 () const
Returns the squared norm of this physical vector.
void normalize ()
Normalizes this dimensionless physical vector.
void normalizeWithUnits ()
Normalizes this physical vector while preserving units.
SBDTypePhysicalVector3< SBQuantity::dimensionless > normalizedVersion () const
Returns the normalized version of this physical vector.
SBDTypePhysicalVector3< Quantity > normalizedVersionWithUnits () const
Returns the normalized version of this physical vector, but with preserved units.
operator SBDTypePhysicalVector3< QuantityB > () const
Converts this physical vector to a physical vector with units QuantityB .
bool operator!= (const SBDTypePhysicalVector3< QuantityB > & u) const
Returns true if this physical vector is different from physical vector u (component-wise)
SBDTypePhysicalVector3< Quantity > operator* (double d) const
Returns the product of this physical vector with double d .
SBDTypePhysicalVector3< SBQuantityType< typename SBDQuantityUnitMultiplication< typename Quantity::UnitType, typename QuantityB::UnitType >::UnitType > > operator* (QuantityB d) const
Returns the product of this physical vector with physical quantity d .
SBDTypePhysicalVector3< SBQuantityType< typename SBDQuantityUnitMultiplication< typename Quantity::UnitType, typename QuantityB::UnitType >::UnitType > > operator* (const SBDTypePhysicalVector3< QuantityB > & u) const
Returns the component-wise product of this physical vector with physical vector u .
SBDTypePhysicalVector3< Quantity > & operator*= (QuantityB d)
Multiplies this physical vector with quantity d .
SBDTypePhysicalVector3< Quantity > operator+ (const SBDTypePhysicalVector3< Quantity > & u) const
Returns the sum of this physical vector with physical vector u .
SBDTypePhysicalVector3< Quantity > & operator+= (const SBDTypePhysicalVector3< Quantity > & u)
Adds physical vector u to this physical vector.
SBDTypePhysicalVector3< Quantity > operator- (const SBDTypePhysicalVector3< Quantity > & u) const
Returns the difference of this physical vector with physical vector u .
SBDTypePhysicalVector3< Quantity > operator- () const
Returns the opposite of this physical vector.
SBDTypePhysicalVector3< Quantity > & operator-= (const SBDTypePhysicalVector3< Quantity > & u)
Subtracts physical vector u from this physical vector.
SBDTypePhysicalVector3< Quantity > operator/ (double d) const
Returns the division of this physical vector by double d .
SBDTypePhysicalVector3< SBQuantityType< typename SBDQuantityUnitDivision< typename Quantity::UnitType, typename QuantityB::UnitType >::UnitType > > operator/ (QuantityB d) const
Returns the division of this physical vector by physical quantity d .
SBDTypePhysicalVector3< SBQuantityType< typename SBDQuantityUnitDivision< typename Quantity::UnitType, typename QuantityB::UnitType >::UnitType > > operator/ (const SBDTypePhysicalVector3< QuantityB > & u) const
Returns the component-wise division of this physical vector by physical vector u .
SBDTypePhysicalVector3< Quantity > & operator/= (QuantityB d)
Divides this physical vector by physical quantity d .
bool operator< (const SBDTypePhysicalVector3< QuantityB > & u) const
Returns true if this physical vector is smaller than physical vector u (lexicographic comparison)
bool operator<= (const SBDTypePhysicalVector3< QuantityB > & u) const
Returns true if this physical vector is smaller or equal than physical vector u (lexicographic comparison)
SBDTypePhysicalVector3< Quantity > & operator= (const SBDTypePhysicalVector3< Quantity > & u)
Copy assignment.
bool operator== (const SBDTypePhysicalVector3< QuantityB > & u) const
Returns true if this physical vector is equal to physical vector u (component-wise)
bool operator> (const SBDTypePhysicalVector3< QuantityB > & u) const
Returns true if this physical vector is larger than physical vector u (lexicographic comparison)
bool operator>= (const SBDTypePhysicalVector3< QuantityB > & u) const
Returns true if this physical vector is larger or equal than physical vector u (lexicographic comparison)
Quantity & operator[] (int index)
Returns a reference to component index .
const Quantity & operator[] (int index) const
Returns a reference to component index (const version)
SBDTypePhysicalVector3< SBQuantityType< typename SBDQuantityUnitMultiplication< typename Quantity::UnitType, typename QuantityB::UnitType >::UnitType > > operator^ (const SBDTypePhysicalVector3< QuantityB > & u) const
Returns the cross product of this physical vector with physical vector u .
SBQuantityProduct2< Quantity, QuantityB >::Type operator| (const SBDTypePhysicalVector3< QuantityB > & u) const
Returns the dot product of this physical vector with physical vector u .
void print () const
Prints this physical vector.
void serialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER) const
Serializes the physical vector using the provided serializer .
void setOne ()
Sets all components to one.
void setValue (const SBDTypePhysicalVector3< SBQuantity::dimensionless > & u)
Sets the components of this physical vector equal to those of the dimensionless physical vector u .
void setZero ()
Sets all components to zero.
void swap (unsigned int i, unsigned j)
Swaps components i andj of this physical vector.
void unserialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER)
Unserializes the physical vector using the provided serializer .
void updateMinMax (SBDTypePhysicalVector3< QuantityLower > & lower, SBDTypePhysicalVector3< QuantityUpper > & upper) const
Updates the lower andupper vector bounds with this physical vector.

Public Static Functions#

Type Name
SBQuantity::radian computeAngle (const SBDTypePhysicalVector3< Quantity > & a, const SBDTypePhysicalVector3< Quantity > & b)
Returns the angle in radians between the vector a and the vectorb .
SBQuantity::radian computeDihedralAngle (const SBDTypePhysicalVector3< SBQuantity::position > & a, const SBDTypePhysicalVector3< SBQuantity::position > & b, const SBDTypePhysicalVector3< SBQuantity::position > & c, const SBDTypePhysicalVector3< SBQuantity::position > & d)
Returns the dihedral angle in radians based on the four given positions a ,b ,c ,d , where positionsb andc form the main axis.
SBDTypePhysicalVector3< Quantity > fromLineProjection (const SBDTypePhysicalVector3< Quantity > & x, const SBDTypePhysicalVector3< Quantity > & a, const SBDTypePhysicalVector3< Quantity > & b, const typename SBQuantityPower< 2, Quantity >::Type & threshold=typename SBQuantityPower< 2, Quantity >::Type(1e-10))
Returns the projection of x on the line passing througha andb . If the squared distance between a and b is below thethreshold , thenx is returned.
SBDTypePhysicalVector3< Quantity > fromLineSegmentProjection (const SBDTypePhysicalVector3< Quantity > & x, const SBDTypePhysicalVector3< Quantity > & a, const SBDTypePhysicalVector3< Quantity > & b, const typename SBQuantityPower< 2, Quantity >::Type & threshold=typename SBQuantityPower< 2, Quantity >::Type(1e-10))
Returns the projection of x on the line segmentab . If the squared distance between a and b is below thethreshold , thenx is returned.
SBDTypePhysicalVector3< Quantity > fromLinearInterpolation (const SBDTypePhysicalVector3< Quantity > & u0, const SBDTypePhysicalVector3< Quantity > & u1, double alpha)
Returns a linear interpolation between two vectors v0 andv1 for a parameteralpha in the closed unit interval [0, 1].
SBDTypePhysicalVector3< Quantity > fromPlaneProjection (const SBDTypePhysicalVector3< Quantity > & x, const SBDTypePhysicalVector3< Quantity > & a, const SBDTypePhysicalVector3< SBQuantity::dimensionless > & n)
Returns the projection of x on the plane passing througha with normaln . The normal is assumed to be normalized.
SBDTypePhysicalVector3< Quantity > fromPlaneProjection (const SBDTypePhysicalVector3< Quantity > & x, const SBDTypePhysicalVector3< Quantity > & a, const SBDTypePhysicalVector3< Quantity > & b, const SBDTypePhysicalVector3< Quantity > & c, const typename SBQuantityPower< 2, Quantity >::Type & threshold=typename SBQuantityPower< 2, Quantity >::Type(1e-10))
Returns the projection of x on the plane passing througha ,b andc . If the length of (c -a ) ^ (b -a ) is smaller thanthreshold , thenx is returned.
void sampledUnitSphere3 (SBVector< SBDTypePhysicalVector3< SBQuantity::dimensionless > > & sampleVector, const unsigned int numberOfPoints)
Populates the sampleVector vector with evenly distributednumberOfPoints points on a unit 3D sphere. The points on a unit 3D sphere are generated using the golden section spiral algorithm.

Detailed Description#

Template parameters:

  • Quantity The quantity type of the physical vector

This template class represents three-dimensional physical vectors, i.e. vectors whose components are physical quantities, and thus use SAMSON's unit system. In a physical vector (e.g. a position vector or a force vector), the three components have the same unit, and the SBDTypePhysicalVector3 template class is parameterized by only one type: Quantity.

Most of the time, developers of SAMSON Extensions do not have to use this template, but may directly use some predefined types, e.g. SBVector3 (dimensionless three-dimensional vector), SBPosition3 (three-dimensional vectors with length dimensions), etc.

For example, if atomPointer is a pointer to an atom, then the atom's position is a SBPosition3 physical vector:

// translate the atom by 1.0 angstrom in the x direction

SBPosition3 p = atomPointer->getPosition();
p.v[0] += SBQuantity::angstrom(1.0);
atomPointer->setPosition(p);

Short name: SBPhysicalVector3

See also: SAMSON's unit system

Public Attributes Documentation#

variable v#

The components of the physical vector.

Quantity v[3];


Public Static Attributes Documentation#

variable one#

The one physical vector, with all components equal to one.

SBDTypePhysicalVector3< Quantity > const one;


variable zero#

The zero physical vector.

SBDTypePhysicalVector3< Quantity > const zero;


Public Functions Documentation#

function SBDTypePhysicalVector3 [1/8]#

Constructs the physical vector [ 0 0 0 ].

inline SBDTypePhysicalVector3::SBDTypePhysicalVector3 () 


function SBDTypePhysicalVector3 [2/8]#

Constructs the physical vector [ x x x ].

inline explicit SBDTypePhysicalVector3::SBDTypePhysicalVector3 (
    const Quantity & x
) 


function SBDTypePhysicalVector3 [3/8]#

Constructs the physical vector [ x y z ].

inline SBDTypePhysicalVector3::SBDTypePhysicalVector3 (
    const Quantity & x,
    const Quantity & y,
    const Quantity & z
) 


function SBDTypePhysicalVector3 [4/8]#

Constructs the physical vector [ v [0]v [1]v [2] ].

inline SBDTypePhysicalVector3::SBDTypePhysicalVector3 (
    Quantity u
) 


function SBDTypePhysicalVector3 [5/8]#

Constructs a dimensionless physical vector with all components set to x .

inline explicit SBDTypePhysicalVector3::SBDTypePhysicalVector3 (
    double x
) 


function SBDTypePhysicalVector3 [6/8]#

Constructs the dimensionless physical vector [ x y z ].

inline SBDTypePhysicalVector3::SBDTypePhysicalVector3 (
    double x,
    double y,
    double z
) 


function SBDTypePhysicalVector3 [7/8]#

Constructs the dimensionless physical vector [ v [0]v [1]v [2] ].

inline SBDTypePhysicalVector3::SBDTypePhysicalVector3 (
    double u
) 


function SBDTypePhysicalVector3 [8/8]#

Copy constructor.

inline SBDTypePhysicalVector3::SBDTypePhysicalVector3 (
    const SBDTypePhysicalVector3 < Quantity > & u
) 


function getValue [1/3]#

Returns a dimensionless physical vector whose components are equal to those of this physical vector.

inline SBDTypePhysicalVector3 < SBQuantity::dimensionless > SBDTypePhysicalVector3::getValue () const


function getValue [2/3]#

Stores the components as doubles in array [0],array [1] andarray [2].

inline void SBDTypePhysicalVector3::getValue (
    double * array
) const


function getValue [3/3]#

Stores the components as floats in array [0],array [1] andarray [2].

inline void SBDTypePhysicalVector3::getValue (
    float * array
) const


function norm#

Returns the norm of this physical vector.

inline Quantity SBDTypePhysicalVector3::norm () const


function norm2#

Returns the squared norm of this physical vector.

inline SBQuantityType< typename SBDQuantityUnitMultiplication< typename Quantity::UnitType, typename Quantity::UnitType >::UnitType > SBDTypePhysicalVector3::norm2 () const


function normalize#

Normalizes this dimensionless physical vector.

inline void SBDTypePhysicalVector3::normalize () 


function normalizeWithUnits#

Normalizes this physical vector while preserving units.

inline void SBDTypePhysicalVector3::normalizeWithUnits () 


function normalizedVersion#

Returns the normalized version of this physical vector.

inline SBDTypePhysicalVector3 < SBQuantity::dimensionless > SBDTypePhysicalVector3::normalizedVersion () const


function normalizedVersionWithUnits#

Returns the normalized version of this physical vector, but with preserved units.

inline SBDTypePhysicalVector3 < Quantity > SBDTypePhysicalVector3::normalizedVersionWithUnits () const


function operator SBDTypePhysicalVector3< QuantityB >#

Converts this physical vector to a physical vector with units QuantityB .

template<typename QuantityB>
inline SBDTypePhysicalVector3::operator SBDTypePhysicalVector3< QuantityB > () const


function operator!=#

Returns true if this physical vector is different from physical vector u (component-wise)

template<typename QuantityB>
inline bool SBDTypePhysicalVector3::operator!= (
    const SBDTypePhysicalVector3 < QuantityB > & u
) const


function operator*#

Returns the product of this physical vector with double d .

inline SBDTypePhysicalVector3 < Quantity > SBDTypePhysicalVector3::operator* (
    double d
) const


function operator*#

Returns the product of this physical vector with physical quantity d .

template<typename QuantityB>
inline SBDTypePhysicalVector3 < SBQuantityType< typename SBDQuantityUnitMultiplication< typename Quantity::UnitType, typename QuantityB::UnitType >::UnitType > > SBDTypePhysicalVector3::operator* (
    QuantityB d
) const


function operator*#

Returns the component-wise product of this physical vector with physical vector u .

template<typename QuantityB>
inline SBDTypePhysicalVector3 < SBQuantityType< typename SBDQuantityUnitMultiplication< typename Quantity::UnitType, typename QuantityB::UnitType >::UnitType > > SBDTypePhysicalVector3::operator* (
    const SBDTypePhysicalVector3 < QuantityB > & u
) const

This operator returns the component-wise product of this physical vector with physical vector u, i.e. a physical vector in which each component is the product of the corresponding components in this physical vector and physical vector u.


function operator*=#

Multiplies this physical vector with quantity d .

template<typename QuantityB>
inline SBDTypePhysicalVector3 < Quantity > & SBDTypePhysicalVector3::operator*= (
    QuantityB d
) 

Parameters:

  • d A dimensionless physical quantity or a numeric type (i.e. int, float, double, etc)

function operator+#

Returns the sum of this physical vector with physical vector u .

inline SBDTypePhysicalVector3 < Quantity > SBDTypePhysicalVector3::operator+ (
    const SBDTypePhysicalVector3 < Quantity > & u
) const


function operator+=#

Adds physical vector u to this physical vector.

inline SBDTypePhysicalVector3 < Quantity > & SBDTypePhysicalVector3::operator+= (
    const SBDTypePhysicalVector3 < Quantity > & u
) 


function operator-#

Returns the difference of this physical vector with physical vector u .

inline SBDTypePhysicalVector3 < Quantity > SBDTypePhysicalVector3::operator- (
    const SBDTypePhysicalVector3 < Quantity > & u
) const


function operator-#

Returns the opposite of this physical vector.

inline SBDTypePhysicalVector3 < Quantity > SBDTypePhysicalVector3::operator- () const


function operator-=#

Subtracts physical vector u from this physical vector.

inline SBDTypePhysicalVector3 < Quantity > & SBDTypePhysicalVector3::operator-= (
    const SBDTypePhysicalVector3 < Quantity > & u
) 


function operator/#

Returns the division of this physical vector by double d .

inline SBDTypePhysicalVector3 < Quantity > SBDTypePhysicalVector3::operator/ (
    double d
) const


function operator/#

Returns the division of this physical vector by physical quantity d .

template<typename QuantityB>
inline SBDTypePhysicalVector3 < SBQuantityType< typename SBDQuantityUnitDivision< typename Quantity::UnitType, typename QuantityB::UnitType >::UnitType > > SBDTypePhysicalVector3::operator/ (
    QuantityB d
) const


function operator/#

Returns the component-wise division of this physical vector by physical vector u .

template<typename QuantityB>
inline SBDTypePhysicalVector3 < SBQuantityType< typename SBDQuantityUnitDivision< typename Quantity::UnitType, typename QuantityB::UnitType >::UnitType > > SBDTypePhysicalVector3::operator/ (
    const SBDTypePhysicalVector3 < QuantityB > & u
) const

This operator returns the component-wise division of this physical vector by physical vector u, i.e. a physical vector in which each component is the division of the corresponding components in this physical vector and physical vector u.


function operator/=#

Divides this physical vector by physical quantity d .

template<typename QuantityB>
inline SBDTypePhysicalVector3 < Quantity > & SBDTypePhysicalVector3::operator/= (
    QuantityB d
) 

Parameters:

  • d A dimensionless physical quantity or a numeric type (i.e. int, float, double, etc)

function operator<#

Returns true if this physical vector is smaller than physical vector u (lexicographic comparison)

template<typename QuantityB>
inline bool SBDTypePhysicalVector3::operator< (
    const SBDTypePhysicalVector3 < QuantityB > & u
) const


function operator<=#

Returns true if this physical vector is smaller or equal than physical vector u (lexicographic comparison)

template<typename QuantityB>
inline bool SBDTypePhysicalVector3::operator<= (
    const SBDTypePhysicalVector3 < QuantityB > & u
) const


function operator=#

Copy assignment.

inline SBDTypePhysicalVector3 < Quantity > & SBDTypePhysicalVector3::operator= (
    const SBDTypePhysicalVector3 < Quantity > & u
) 


function operator==#

Returns true if this physical vector is equal to physical vector u (component-wise)

template<typename QuantityB>
inline bool SBDTypePhysicalVector3::operator== (
    const SBDTypePhysicalVector3 < QuantityB > & u
) const


function operator>#

Returns true if this physical vector is larger than physical vector u (lexicographic comparison)

template<typename QuantityB>
inline bool SBDTypePhysicalVector3::operator> (
    const SBDTypePhysicalVector3 < QuantityB > & u
) const


function operator>=#

Returns true if this physical vector is larger or equal than physical vector u (lexicographic comparison)

template<typename QuantityB>
inline bool SBDTypePhysicalVector3::operator>= (
    const SBDTypePhysicalVector3 < QuantityB > & u
) const


function operator[]#

Returns a reference to component index .

inline Quantity & SBDTypePhysicalVector3::operator[] (
    int index
) 


function operator[]#

Returns a reference to component index (const version)

inline const Quantity & SBDTypePhysicalVector3::operator[] (
    int index
) const


function operator^#

Returns the cross product of this physical vector with physical vector u .

template<typename QuantityB>
inline SBDTypePhysicalVector3 < SBQuantityType< typename SBDQuantityUnitMultiplication< typename Quantity::UnitType, typename QuantityB::UnitType >::UnitType > > SBDTypePhysicalVector3::operator^ (
    const SBDTypePhysicalVector3 < QuantityB > & u
) const


function operator|#

Returns the dot product of this physical vector with physical vector u .

template<typename QuantityB>
inline SBQuantityProduct2< Quantity, QuantityB >::Type SBDTypePhysicalVector3::operator| (
    const SBDTypePhysicalVector3 < QuantityB > & u
) const


function print#

Prints this physical vector.

inline void SBDTypePhysicalVector3::print () const


function serialize#

Serializes the physical vector using the provided serializer .

inline void SBDTypePhysicalVector3::serialize (
    SBCSerializer * serializer,
    const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
) const


function setOne#

Sets all components to one.

inline void SBDTypePhysicalVector3::setOne () 


function setValue#

Sets the components of this physical vector equal to those of the dimensionless physical vector u .

inline void SBDTypePhysicalVector3::setValue (
    const SBDTypePhysicalVector3 < SBQuantity::dimensionless > & u
) 


function setZero#

Sets all components to zero.

inline void SBDTypePhysicalVector3::setZero () 


function swap#

Swaps components i andj of this physical vector.

inline void SBDTypePhysicalVector3::swap (
    unsigned int i,
    unsigned j
) 


function unserialize#

Unserializes the physical vector using the provided serializer .

inline void SBDTypePhysicalVector3::unserialize (
    SBCSerializer * serializer,
    const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
) 


function updateMinMax#

Updates the lower andupper vector bounds with this physical vector.

template<typename QuantityLower, typename QuantityUpper>
inline void SBDTypePhysicalVector3::updateMinMax (
    SBDTypePhysicalVector3 < QuantityLower > & lower,
    SBDTypePhysicalVector3 < QuantityUpper > & upper
) const

Parameters:

  • lower The lower bound
  • upper The upper bound

If necessary, this function updates the lower and upper bounds to ensure that they contain this physical vector.


Public Static Functions Documentation#

function computeAngle#

Returns the angle in radians between the vector a and the vectorb .

static inline SBQuantity::radian SBDTypePhysicalVector3::computeAngle (
    const SBDTypePhysicalVector3 < Quantity > & a,
    const SBDTypePhysicalVector3 < Quantity > & b
) 


function computeDihedralAngle#

Returns the dihedral angle in radians based on the four given positions a ,b ,c ,d , where positionsb andc form the main axis.

static inline SBQuantity::radian SBDTypePhysicalVector3::computeDihedralAngle (
    const SBDTypePhysicalVector3 < SBQuantity::position > & a,
    const SBDTypePhysicalVector3 < SBQuantity::position > & b,
    const SBDTypePhysicalVector3 < SBQuantity::position > & c,
    const SBDTypePhysicalVector3 < SBQuantity::position > & d
) 


function fromLineProjection#

Returns the projection of x on the line passing througha andb . If the squared distance between a and b is below thethreshold , thenx is returned.

static inline SBDTypePhysicalVector3 < Quantity > SBDTypePhysicalVector3::fromLineProjection (
    const SBDTypePhysicalVector3 < Quantity > & x,
    const SBDTypePhysicalVector3 < Quantity > & a,
    const SBDTypePhysicalVector3 < Quantity > & b,
    const typename SBQuantityPower< 2, Quantity >::Type & threshold=typename SBQuantityPower< 2, Quantity >::Type(1e-10)
) 


function fromLineSegmentProjection#

Returns the projection of x on the line segmentab . If the squared distance between a and b is below thethreshold , thenx is returned.

static inline SBDTypePhysicalVector3 < Quantity > SBDTypePhysicalVector3::fromLineSegmentProjection (
    const SBDTypePhysicalVector3 < Quantity > & x,
    const SBDTypePhysicalVector3 < Quantity > & a,
    const SBDTypePhysicalVector3 < Quantity > & b,
    const typename SBQuantityPower< 2, Quantity >::Type & threshold=typename SBQuantityPower< 2, Quantity >::Type(1e-10)
) 


function fromLinearInterpolation#

Returns a linear interpolation between two vectors v0 andv1 for a parameteralpha in the closed unit interval [0, 1].

static inline SBDTypePhysicalVector3 < Quantity > SBDTypePhysicalVector3::fromLinearInterpolation (
    const SBDTypePhysicalVector3 < Quantity > & u0,
    const SBDTypePhysicalVector3 < Quantity > & u1,
    double alpha
) 


function fromPlaneProjection [1/2]#

Returns the projection of x on the plane passing througha with normaln . The normal is assumed to be normalized.

static inline SBDTypePhysicalVector3 < Quantity > SBDTypePhysicalVector3::fromPlaneProjection (
    const SBDTypePhysicalVector3 < Quantity > & x,
    const SBDTypePhysicalVector3 < Quantity > & a,
    const SBDTypePhysicalVector3 < SBQuantity::dimensionless > & n
) 


function fromPlaneProjection [2/2]#

Returns the projection of x on the plane passing througha ,b andc . If the length of (c -a ) ^ (b -a ) is smaller thanthreshold , thenx is returned.

static inline SBDTypePhysicalVector3 < Quantity > SBDTypePhysicalVector3::fromPlaneProjection (
    const SBDTypePhysicalVector3 < Quantity > & x,
    const SBDTypePhysicalVector3 < Quantity > & a,
    const SBDTypePhysicalVector3 < Quantity > & b,
    const SBDTypePhysicalVector3 < Quantity > & c,
    const typename SBQuantityPower< 2, Quantity >::Type & threshold=typename SBQuantityPower< 2, Quantity >::Type(1e-10)
) 


function sampledUnitSphere3#

Populates the sampleVector vector with evenly distributednumberOfPoints points on a unit 3D sphere. The points on a unit 3D sphere are generated using the golden section spiral algorithm.

static inline void SBDTypePhysicalVector3::sampledUnitSphere3 (
    SBVector< SBDTypePhysicalVector3 < SBQuantity::dimensionless > > & sampleVector,
    const unsigned int numberOfPoints
) 

See also: SBDTypeRandom::randUnitSphere3