53template <
class T =
int>
75 template <
typename CastingType>
115 x( aX ), y( aY ), z( aZ )
121template <
typename CastingType>
123 x( aVec.x ), y( aVec.y ), z( aVec.z )
131 return VECTOR3<T>( ( y * aVector.
z ) - ( z * aVector.
y ),
132 ( z * aVector.
x ) - ( x * aVector.
z ),
133 ( x * aVector.
y ) - ( y * aVector.
x )
157 T norm = EuclideanNorm();
159 wxCHECK_MSG( norm > T( 0 ), *
this, wxT(
"Invalid element length 0" ) );
172 return ( aVector.
x == x ) && ( aVector.
y == y ) && ( aVector.
z == z );
179 return ( aVector.
x != x ) || ( aVector.
y != y ) || ( aVector.
z != z );
208 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 > 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.
std::ostream & operator<<(std::ostream &aStream, const EDA_TEXT &aText)
Traits class for VECTOR2.
T extended_type
extended range/precision types used by operations involving multiple multiplications to prevent overf...
VECTOR3< unsigned int > VECTOR3U
VECTOR3< double > VECTOR3D