Point

group point

A point is represented as the multivector \(x\mathbf{e}_{032} + y\mathbf{e}_{013} + z\mathbf{e}_{021} + \mathbf{e}_{123}\). The point has a trivector representation because it is the fixed point of 3 planar reflections (each of which is a grade-1 multivector). In practice, the coordinate mapping can be thought of as an implementation detail.

Summary

Members Descriptions
public point() = default
public point(__m128 xmm) noexcept
public point(float x,float y,float z) noexcept Component-wise constructor (homogeneous coordinate is automatically initialized to 1)
public void load(float * data) noexcept Fast load from a pointer to an array of four floats with layout (w, x, y, z) where w occupies the lowest address in memory.
public void normalize() noexcept Normalize this point (division is done via rcpps with an additional Newton-Raphson refinement).
public point normalized() const noexcept Return a normalized copy of this point.
public void invert() noexcept
public point inverse() const noexcept
public float x() const noexcept
public float e032() const noexcept
public float y() const noexcept
public float e013() const noexcept
public float z() const noexcept
public float e021() const noexcept
public float w() const noexcept The homogeneous coordinate w is exactly \(1\) when normalized.
public float e123() const noexcept
public point &KLN_VEC_CALL operator+=(point b) noexcept Point addition.
public point &KLN_VEC_CALL operator-=(point b) noexcept Point subtraction.
public point & operator*=(float s) noexcept Point uniform scale.
public point & operator*=(int s) noexcept Point uniform scale.
public point & operator/=(float s) noexcept Point uniform inverse scale.
public point & operator/=(int s) noexcept Point uniform inverse scale.
public point KLN_VEC_CALL operator+(point a,point b) noexcept Point addition.
public point KLN_VEC_CALL operator-(point a,point b) noexcept Point subtraction.
public point KLN_VEC_CALL operator*(point p,float s) noexcept Point uniform scale.
public point KLN_VEC_CALL operator*(float s,point p) noexcept Point uniform scale.
public point KLN_VEC_CALL operator*(point p,int s) noexcept Point uniform scale.
public point KLN_VEC_CALL operator*(int s,point p) noexcept Point uniform scale.
public point KLN_VEC_CALL operator/(point p,float s) noexcept Point uniform inverse scale.
public point KLN_VEC_CALL operator/(point p,int s) noexcept Point uniform inverse scale.
public point KLN_VEC_CALL operator-(point p) noexcept Unary minus (leaves homogeneous coordinate untouched)
public point KLN_VEC_CALL operator~(point p) noexcept Reversion operator.
public operator point() const noexcept On its own, the origin occupies no memory, but it can be casted as an entity at any point, at which point it is represented as \(\mathbf{e}_{123}\).

Members

point() = default

point(__m128 xmm) noexcept

point(float x,float y,float z) noexcept

Component-wise constructor (homogeneous coordinate is automatically initialized to 1)

void load(float * data) noexcept

Fast load from a pointer to an array of four floats with layout (w, x, y, z) where w occupies the lowest address in memory.

Tip

This load operation is more efficient that modifying individual components back-to-back.

Danger

Unlike the component-wise constructor, the load here requires the homogeneous coordinate w to be supplied as well in the lowest address pointed to by data.

void normalize() noexcept

Normalize this point (division is done via rcpps with an additional Newton-Raphson refinement).

point normalized() const noexcept

Return a normalized copy of this point.

void invert() noexcept

point inverse() const noexcept

float x() const noexcept

float e032() const noexcept

float y() const noexcept

float e013() const noexcept

float z() const noexcept

float e021() const noexcept

float w() const noexcept

The homogeneous coordinate w is exactly \(1\) when normalized.

float e123() const noexcept

point &KLN_VEC_CALL operator+=(point b) noexcept

Point addition.

point &KLN_VEC_CALL operator-=(point b) noexcept

Point subtraction.

point & operator*=(float s) noexcept

Point uniform scale.

point & operator*=(int s) noexcept

Point uniform scale.

point & operator/=(float s) noexcept

Point uniform inverse scale.

point & operator/=(int s) noexcept

Point uniform inverse scale.

point KLN_VEC_CALL operator+(point a,point b) noexcept

Point addition.

point KLN_VEC_CALL operator-(point a,point b) noexcept

Point subtraction.

point KLN_VEC_CALL operator*(point p,float s) noexcept

Point uniform scale.

point KLN_VEC_CALL operator*(float s,point p) noexcept

Point uniform scale.

point KLN_VEC_CALL operator*(point p,int s) noexcept

Point uniform scale.

point KLN_VEC_CALL operator*(int s,point p) noexcept

Point uniform scale.

point KLN_VEC_CALL operator/(point p,float s) noexcept

Point uniform inverse scale.

point KLN_VEC_CALL operator/(point p,int s) noexcept

Point uniform inverse scale.

point KLN_VEC_CALL operator-(point p) noexcept

Unary minus (leaves homogeneous coordinate untouched)

point KLN_VEC_CALL operator~(point p) noexcept

Reversion operator.

operator point() const noexcept

On its own, the origin occupies no memory, but it can be casted as an entity at any point, at which point it is represented as \(\mathbf{e}_{123}\).