53template <
class T =
int>
75 template <
typename CastingType>
120 x( aX ),
y( aY ),
z( aZ )
126template <
typename CastingType>
128 x( aVec.
x ),
y( aVec.
y ),
z( aVec.
z )
137 (
z * aVector.
x ) - (
x * aVector.
z ),
138 (
x * aVector.
y ) - (
y * aVector.
x )
164 wxCHECK_MSG( norm >
T( 0 ), *
this, wxT(
"Invalid element length 0" ) );
188 return ( aVector.
x ==
x ) && ( aVector.
y ==
y ) && ( aVector.
z ==
z );
195 return ( aVector.
x !=
x ) || ( aVector.
y !=
y ) || ( aVector.
z !=
z );
224 aStream <<
"[ " << aVector.
x <<
" | " << aVector.
y <<
" | " << aVector.
z <<
" ]";
Define a general 3D-vector.
VECTOR3< T > & operator*=(T val)
static constexpr extended_type ECOORD_MAX
VECTOR3< T >::extended_type Dot(const VECTOR3< T > &aVector) const
Compute the dot product of self with aVector.
VECTOR3< T > SetAll(T val)
Set all elements to val.
VECTOR3< T > Normalize()
Compute the normalized vector.
VECTOR3(T x, T y, T z)
Construct a vector with given components x, y, z.
VECTOR3_TRAITS< T >::extended_type extended_type
bool operator==(const VECTOR3< T > &aVector) const
Equality operator.
VECTOR3< T > Cross(const VECTOR3< T > &aVector) const
Compute cross product of self with aVector.
static constexpr extended_type ECOORD_MIN
T EuclideanNorm() const
Compute the Euclidean norm of the vector, which is defined as sqrt(x ** 2 + y ** 2).
bool operator!=(const VECTOR3< T > &aVector) const
Not equality operator.
VECTOR3()=default
Construct a 3D-vector with x, y, z = 0.
VECTOR3< T > & operator/=(T val)
VECTOR3(const VECTOR3< CastingType > &aVec)
Initializes a vector from another specialization.
Traits class for VECTOR2.
T extended_type
extended range/precision types used by operations involving multiple multiplications to prevent overf...
std::ostream & operator<<(std::ostream &aStream, const VECTOR3< T > &aVector)
VECTOR3< unsigned int > VECTOR3U
VECTOR3< double > VECTOR3D