Aardvark.Base


Rot3d

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

Constructors

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

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

new(w, v)
Signature: (w:float * v:V3d) -> unit

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

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

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

new(a, start)
Signature: (a:float [] * 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:V3d * angleInRadians:float) -> unit

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

new(...)
Signature: (yawInRadians:float * pitchInRadians:float * rollInRadians:float) -> unit
new(from, into)
Signature: (from:V3d * into:V3d) -> 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: Rot3d

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: Rot3d

Gets the (multiplicative) inverse of this quaternion.

Invert()
Signature: unit -> unit

Inverts this quaternion (multiplicative inverse). Returns this.

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

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

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

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: float

Gets norm (or length) of this quaternion.

Normalize()
Signature: unit -> unit

Normalizes this quaternion.

Normalized
Signature: Rot3d

Gets normalized (unit) quaternion from this quaternion.

NormSquared
Signature: float

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

OneDividedBy()
Signature: unit -> Rot3d

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

ToAngleAxis()
Signature: unit -> V3d

Returns the Rodrigues angle-axis vector of the quaternion.

ToAxisAngle(axis, angleInRadians)
Signature: (axis:byref<V3d> * angleInRadians:byref<float>) -> unit

Converts this Rotation to the axis angle representation.

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

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

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

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:Rot3d * b:Rot3d) -> Rot3d

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

Add(q, s)
Signature: (q:Rot3d * s:float) -> Rot3d

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

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

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

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

Divides 2 quaternions.

Dot(a, b)
Signature: (a:Rot3d * b:Rot3d) -> float

Returns the dot-product of 2 quaternions.

FromAngleAxis(angleAxis)
Signature: angleAxis:V3d -> Rot3d

Create from Rodrigues axis-angle vactor

FromFrame(x, y, z)
Signature: (x:V3d * y:V3d * z:V3d) -> Rot3d

WARNING: UNTESTED!!!

FromM33d(m, epsilon)
Signature: (m:M33d * epsilon:float) -> Rot3d

Creates a quaternion from a rotation matrix

InvTransformDir(q, v)
Signature: (q:Rot3d * v:V3d) -> V3d

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

InvTransformPos(q, p)
Signature: (q:Rot3d * p:V3d) -> V3d

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:Rot3d * s:float) -> Rot3d

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

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

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

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

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

op_Addition(a, b)
Signature: (a:Rot3d * b:Rot3d) -> Rot3d
op_Addition(rot, s)
Signature: (rot:Rot3d * s:float) -> Rot3d
op_Addition(s, rot)
Signature: (s:float * rot:Rot3d) -> Rot3d
op_Division(rot, s)
Signature: (rot:Rot3d * s:float) -> Rot3d
op_Division(s, rot)
Signature: (s:float * rot:Rot3d) -> Rot3d
op_Equality(r0, r1)
Signature: (r0:Rot3d * r1:Rot3d) -> bool
op_Explicit(r)
Signature: r:Rot3d -> M33d
op_Explicit(r)
Signature: r:Rot3d -> M44d
op_Explicit(r)
Signature: r:Rot3d -> M34d
op_Explicit(r)
Signature: r:Rot3d -> float []
op_Inequality(r0, r1)
Signature: (r0:Rot3d * r1:Rot3d) -> bool
op_Multiply(rot, s)
Signature: (rot:Rot3d * s:float) -> Rot3d
op_Multiply(s, rot)
Signature: (s:float * rot:Rot3d) -> Rot3d
op_Multiply(a, b)
Signature: (a:Rot3d * b:Rot3d) -> Rot3d
op_Multiply(rot, m)
Signature: (rot:Rot3d * m:Scale3d) -> M33d
op_Multiply(rot, m)
Signature: (rot:Rot3d * m:Shift3d) -> M34d
op_Multiply(rot, m)
Signature: (rot:Rot3d * m:M33d) -> M33d
op_Multiply(m, rot)
Signature: (m:M33d * rot:Rot3d) -> M33d
op_Subtraction(a, b)
Signature: (a:Rot3d * b:Rot3d) -> Rot3d
op_Subtraction(rot, s)
Signature: (rot:Rot3d * s:float) -> Rot3d
op_Subtraction(scalar, rot)
Signature: (scalar:float * rot:Rot3d) -> Rot3d
op_UnaryNegation(rot)
Signature: rot:Rot3d -> Rot3d
Parse(s)
Signature: s:string -> Rot3d
Reciprocal(q)
Signature: q:Rot3d -> Rot3d

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:Rot3d * s:float) -> Rot3d

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

Subtract(s, q)
Signature: (s:float * q:Rot3d) -> Rot3d

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

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

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

TransformDir(q, v)
Signature: (q:Rot3d * v:V3d) -> V3d

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

TransformPos(q, p)
Signature: (q:Rot3d * p:V3d) -> V3d

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