Aardvark.Base


Rot3f

Represents an arbitrary rotation in three dimensions. Implemented as a normalized quaternion.

Constructors

ConstructorDescription
new(w, x, y, z)
Signature: (w:float32 * x:float32 * y:float32 * z:float32) -> unit

Creates quaternion (w, (x, y, z)).

new(w, v)
Signature: (w:float32 * v:V3f) -> unit

Creates quaternion (w, (v.x, v.y, v.z)).

new(a)
Signature: (a:float32 []) -> unit

Creates quaternion from array. (w = a[0], (x = a[1], y = a[2], z = a[3])).

new(a, start)
Signature: (a:float32 [] * start:int) -> unit

Creates quaternion from array starting at specified index. (w = a[start], (x = a[start+1], y = a[start+2], z = a[start+3])).

new(axis, angleInRadians)
Signature: (axis:V3f * angleInRadians:float32) -> unit

Creates quaternion representing a rotation around an axis by an angle.

new(...)
Signature: (yawInRadians:float32 * pitchInRadians:float32 * rollInRadians:float32) -> unit
new(from, into)
Signature: (from:V3f * into:V3f) -> unit

Creates a quaternion representing a rotation from one vector into another.

Instance members

Instance memberDescription
Conjugate()
Signature: unit -> unit

Conjugates this quaternion. Returns this. For normalized rotation-quaternions this is the same as Invert().

Conjugated
Signature: Rot3f

Gets the conjugate of this quaternion. For normalized rotation-quaternions this is the same as Inverted().

Equals(other)
Signature: other:obj -> bool
Modifiers: abstract
GetEulerAngles()
Signature: unit -> V3d

Returns the Euler-Angles from the quatarnion.

GetHashCode()
Signature: unit -> int
Modifiers: abstract
Inverse
Signature: Rot3f

Gets the (multiplicative) inverse of this quaternion.

Invert()
Signature: unit -> unit

Inverts this quaternion (multiplicative inverse). Returns this.

InvTransformDir(v)
Signature: v:V3f -> V3f

Transforms direction vector v (v.w is presumed 0.0) by the inverse of this quaternion.

InvTransformPos(p)
Signature: p:V3f -> V3f

Transforms point p (p.w is presumed 1.0) by the inverse of this quaternion. For quaternions, this method is equivalent to TransformDir, and is made available only to provide a consistent set of operations for all transforms.

[()]
Signature: unit -> int
Norm
Signature: float32

Gets norm (or length) of this quaternion.

Normalize()
Signature: unit -> unit

Normalizes this quaternion.

Normalized
Signature: Rot3f

Gets normalized (unit) quaternion from this quaternion.

NormSquared
Signature: float32

Gets squared norm (or squared length) of this quaternion.

OneDividedBy()
Signature: unit -> Rot3f

Returns the component-wise reciprocal (1/w, 1/x, 1/y, 1/z).

ToAngleAxis()
Signature: unit -> V3f

Returns the Rodrigues angle-axis vector of the quaternion.

ToAxisAngle(axis, angleInRadians)
Signature: (axis:byref<V3f> * angleInRadians:byref<float32>) -> unit

Converts this Rotation to the axis angle representation.

ToString()
Signature: unit -> string
Modifiers: abstract
TransformDir(v)
Signature: v:V3f -> V3f

Transforms direction vector v (v.w is presumed 0.0) by this quaternion.

TransformPos(p)
Signature: p:V3f -> V3f

Transforms point p (p.w is presumed 1.0) by this quaternion. For quaternions, this method is equivalent to TransformDir, and is made available only to provide a consistent set of operations for all transforms.

X()
Signature: unit -> unit
Y()
Signature: unit -> unit
Z()
Signature: unit -> unit

Static members

Static memberDescription
Add(a, b)
Signature: (a:Rot3f * b:Rot3f) -> Rot3f

Returns the sum of 2 quaternions (a.w + b.w, a.v + b.v).

Add(q, s)
Signature: (q:Rot3f * s:float32) -> Rot3f

Returns (q.w + s, (q.x + s, q.y + s, q.z + s)).

ApproxEqual(r0, r1)
Signature: (r0:Rot3f * r1:Rot3f) -> bool
ApproxEqual(r0, r1, tolerance)
Signature: (r0:Rot3f * r1:Rot3f * tolerance:float32) -> bool
Divide(s, q)
Signature: (s:float32 * q:Rot3f) -> Rot3f
Divide(q, s)
Signature: (q:Rot3f * s:float32) -> Rot3f

Returns (q.w / s, q.v * (1/s)).

Divide(a, b)
Signature: (a:Rot3f * b:Rot3f) -> Rot3f

Divides 2 quaternions.

Dot(a, b)
Signature: (a:Rot3f * b:Rot3f) -> float32

Returns the dot-product of 2 quaternions.

FromAngleAxis(angleAxis)
Signature: angleAxis:V3f -> Rot3f

Create from Rodrigues axis-angle vactor

FromFrame(x, y, z)
Signature: (x:V3f * y:V3f * z:V3f) -> Rot3f

WARNING: UNTESTED!!!

FromM33f(m, epsilon)
Signature: (m:M33f * epsilon:float32) -> Rot3f

Creates a quaternion from a rotation matrix

InvTransformDir(q, v)
Signature: (q:Rot3f * v:V3f) -> V3f

Transforms direction vector v (v.w is presumed 0.0) by the inverse of quaternion q.

InvTransformPos(q, p)
Signature: (q:Rot3f * p:V3f) -> V3f

Transforms point p (p.w is presumed 1.0) by the incerse of quaternion q. For quaternions, this method is equivalent to InvTransformDir, and is made available only to provide a consistent set of operations for all transforms.

Multiply(q, s)
Signature: (q:Rot3f * s:float32) -> Rot3f

Returns (q.w s, q.v s).

Multiply(a, b)
Signature: (a:Rot3f * b:Rot3f) -> Rot3f

Multiplies 2 quaternions. This concatenates the two rotations into a single one. Attention: Multiplication is NOT commutative!

Negated(q)
Signature: q:Rot3f -> Rot3f

Returns the component-wise negation (-q.w, -q.v) of quaternion q. This represents the same rotation.

op_Addition(a, b)
Signature: (a:Rot3f * b:Rot3f) -> Rot3f
op_Addition(rot, s)
Signature: (rot:Rot3f * s:float32) -> Rot3f
op_Addition(s, rot)
Signature: (s:float32 * rot:Rot3f) -> Rot3f
op_Division(rot, s)
Signature: (rot:Rot3f * s:float32) -> Rot3f
op_Division(s, rot)
Signature: (s:float32 * rot:Rot3f) -> Rot3f
op_Equality(r0, r1)
Signature: (r0:Rot3f * r1:Rot3f) -> bool
op_Explicit(r)
Signature: r:Rot3f -> M33f
op_Explicit(r)
Signature: r:Rot3f -> M44f
op_Explicit(r)
Signature: r:Rot3f -> M34f
op_Explicit(r)
Signature: r:Rot3f -> float32 []
op_Inequality(r0, r1)
Signature: (r0:Rot3f * r1:Rot3f) -> bool
op_Multiply(rot, s)
Signature: (rot:Rot3f * s:float32) -> Rot3f
op_Multiply(s, rot)
Signature: (s:float32 * rot:Rot3f) -> Rot3f
op_Multiply(a, b)
Signature: (a:Rot3f * b:Rot3f) -> Rot3f
op_Multiply(rot, m)
Signature: (rot:Rot3f * m:Scale3f) -> M33f
op_Multiply(rot, m)
Signature: (rot:Rot3f * m:Shift3f) -> M34f
op_Multiply(rot, m)
Signature: (rot:Rot3f * m:M33f) -> M33f
op_Multiply(m, rot)
Signature: (m:M33f * rot:Rot3f) -> M33f
op_Subtraction(a, b)
Signature: (a:Rot3f * b:Rot3f) -> Rot3f
op_Subtraction(rot, s)
Signature: (rot:Rot3f * s:float32) -> Rot3f
op_Subtraction(scalar, rot)
Signature: (scalar:float32 * rot:Rot3f) -> Rot3f
op_UnaryNegation(rot)
Signature: rot:Rot3f -> Rot3f
Parse(s)
Signature: s:string -> Rot3f
Reciprocal(q)
Signature: q:Rot3f -> Rot3f

Returns the component-wise reciprocal (1/q.w, 1/q.x, 1/q.y, 1/q.z) of quaternion q.

Subtract(q, s)
Signature: (q:Rot3f * s:float32) -> Rot3f

Returns (q.w - s, (q.x - s, q.y - s, q.z - s)).

Subtract(s, q)
Signature: (s:float32 * q:Rot3f) -> Rot3f

Returns (s - q.w, (s - q.x, s- q.y, s- q.z)).

Subtract(a, b)
Signature: (a:Rot3f * b:Rot3f) -> Rot3f

Returns (a.w - b.w, a.v - b.v).

TransformDir(q, v)
Signature: (q:Rot3f * v:V3f) -> V3f

Transforms direction vector v (v.w is presumed 0.0) by quaternion q.

TransformPos(q, p)
Signature: (q:Rot3f * p:V3f) -> V3f

Transforms point p (p.w is presumed 1.0) by quaternion q. For quaternions, this method is equivalent to TransformDir, and is made available only to provide a consistent set of operations for all transforms.

Fork me on GitHub