# Direction

## group dir

Directions in $$\mathbf{P}(\mathbb{R}^3_{3, 0, 1})$$ are represented using points at infinity (homogeneous coordinate 0). Having a homogeneous coordinate of zero ensures that directions are translation-invariant.

### Summary

Members Descriptions
public direction() = default
public direction(float x,float y,float z) noexcept Create a normalized direction.
public direction(__m128 p3) noexcept
public explicit direction(float * data) noexcept Data should point to four floats with memory layout (0.f, x, y, z) where the zero occupies the lowest address in memory.
public float x() const noexcept
public float y() const noexcept
public float z() const noexcept
public void normalize() noexcept Normalize this direction by dividing all components by the magnitude (by default, rsqrtps is used with a single Newton-Raphson refinement iteration)
public direction normalized() const noexcept Return a normalized copy of this direction.
public direction &KLN_VEC_CALL operator+=(direction b) noexcept Direction addition.
public direction &KLN_VEC_CALL operator-=(direction b) noexcept Direction subtraction.
public direction & operator*=(float s) noexcept Direction uniform scale.
public direction & operator*=(int s) noexcept Direction uniform scale.
public direction & operator/=(float s) noexcept Direction uniform inverse scale.
public direction & operator/=(int s) noexcept Direction uniform inverse scale.
public direction KLN_VEC_CALL operator+(direction a,direction b) noexcept Direction addition.
public direction KLN_VEC_CALL operator-(direction a,direction b) noexcept Direction subtraction.
public direction KLN_VEC_CALL operator*(direction d,float s) noexcept Direction uniform scale.
public direction KLN_VEC_CALL operator*(float s,direction d) noexcept Direction uniform scale.
public direction KLN_VEC_CALL operator*(direction d,int s) noexcept Direction uniform scale.
public direction KLN_VEC_CALL operator*(int s,direction d) noexcept Direction uniform scale.
public direction KLN_VEC_CALL operator/(direction d,float s) noexcept Direction uniform inverse scale.
public direction KLN_VEC_CALL operator/(direction d,int s) noexcept Direction uniform inverse scale.
public direction operator-(direction d) noexcept Unary minus.

### Members

#### direction(float x,float y,float z) noexcept

Create a normalized direction.

#### explicit direction(float * data) noexcept

Data should point to four floats with memory layout (0.f, x, y, z) where the zero occupies the lowest address in memory.

#### void normalize() noexcept

Normalize this direction by dividing all components by the magnitude (by default, rsqrtps is used with a single Newton-Raphson refinement iteration)

#### direction normalized() const noexcept

Return a normalized copy of this direction.

#### direction &KLN_VEC_CALL operator-=(direction b) noexcept

Direction subtraction.

#### direction & operator*=(float s) noexcept

Direction uniform scale.

#### direction & operator*=(int s) noexcept

Direction uniform scale.

#### direction & operator/=(float s) noexcept

Direction uniform inverse scale.

#### direction & operator/=(int s) noexcept

Direction uniform inverse scale.

#### direction KLN_VEC_CALL operator-(direction a,direction b) noexcept

Direction subtraction.

#### direction KLN_VEC_CALL operator*(direction d,float s) noexcept

Direction uniform scale.

#### direction KLN_VEC_CALL operator*(float s,direction d) noexcept

Direction uniform scale.

#### direction KLN_VEC_CALL operator*(direction d,int s) noexcept

Direction uniform scale.

#### direction KLN_VEC_CALL operator*(int s,direction d) noexcept

Direction uniform scale.

#### direction KLN_VEC_CALL operator/(direction d,float s) noexcept

Direction uniform inverse scale.

#### direction KLN_VEC_CALL operator/(direction d,int s) noexcept

Direction uniform inverse scale.

Unary minus.