Bromeon
Functions
Vectors/VectorAlgebra3D.hpp File Reference

Algebraic operations on three-dimensional vectors (dot and cross product, vector length and angles, ...) More...

Go to the source code of this file.

Functions

template<typename T >
thor::Length (const sf::Vector3< T > &vector)
 Returns the length of the 3D vector.
template<typename T >
thor::SquaredLength (const sf::Vector3< T > &vector)
 Returns the square of vector's length.
template<typename T >
sf::Vector3< T > thor::UnitVector (const sf::Vector3< T > &vector)
 Returns a vector with same direction as the argument, but with length 1.
template<typename T >
thor::PolarAngle (const sf::Vector3< T > &vector)
 Returns the angle between the projection of vector onto the XY-plane and the X-axis.
template<typename T >
thor::ElevationAngle (const sf::Vector3< T > &vector)
 Returns the elevation angle of vector.
template<typename T >
thor::DotProduct (const sf::Vector3< T > &lhs, const sf::Vector3< T > &rhs)
 Computes the dot product of two 3D vectors.
template<typename T >
sf::Vector3< T > thor::CrossProduct (const sf::Vector3< T > &lhs, const sf::Vector3< T > &rhs)
 Computes the cross product of two 3D vectors.
template<typename T >
sf::Vector3< T > thor::ComponentwiseProduct (const sf::Vector3< T > &lhs, const sf::Vector3< T > &rhs)
 Returns the component-wise product of lhs and rhs.
template<typename T >
sf::Vector3< T > thor::ComponentwiseQuotient (const sf::Vector3< T > &lhs, const sf::Vector3< T > &rhs)
 Returns the component-wise quotient of lhs and rhs.
template<typename DestType , typename SourceType >
sf::Vector3< DestType > thor::ConvertVector (const sf::Vector3< SourceType > &vector)
 Converts vectors of different types.
template<typename T >
sf::Vector3< T > thor::ToVector3 (const sf::Vector2< T > &vector2)
 Constructs a 3D vector from a 2D vector by setting the Z component to zero.

Detailed Description

Algebraic operations on three-dimensional vectors (dot and cross product, vector length and angles, ...)

Here is an overview over the functionality:

DotProduct(v,w) Length(v) UnitVector(v)
CrossProduct(v,w) SquaredLength(v) ToVector3(v)
ComponentwiseProduct(v,w) PolarAngle(v) ConvertVector<T>(v)
ComponentwiseQuotient(v,w) ElevationAngle(v)