nphollon / geo3d / Frame

A Frame describes the difference between two coordinate systems -- the position and orientation of one reference frame relative to another.

Definition


type alias Frame =
{ position : Vector
, orientation : Quaternion 
}

Frame consists of a position and an orientation.

identity : Frame

The identity frame corresponds to no transformation.

equal : Frame -> Frame -> Basics.Bool

Two frames are equal if their positions and orientations match.

Coordinate Transformations

transformInto : Frame -> Vector -> Vector

Given a frame and an extrinsic vector, return the corresponding intrinsic vector.

transformOutOf : Frame -> Vector -> Vector

Given a frame and an intrinsic vector, return the corresponding extrinsic vector.

mul : Frame -> Frame -> Frame

Given a frame B to C, and another frame A to B, return the frame A to C.

compose : Frame -> Frame -> Frame

Given a frame A to B, and another frame B to C, return the frame A to C.

transformOutOf (compose a b) == transformOutOf b >> transformOutOf a
transformInto (compose a b) == transformInto a >> transformInto b

inverse : Frame -> Frame

Given a frame A to B, return the frame B to A

Mutating Frames

setPosition : Vector -> Frame -> Frame

Set the position of a frame.

intrinsicNudge : Vector -> Frame -> Frame

Translate a frame by a displacement definined within the frame.

extrinsicNudge : Vector -> Frame -> Frame

Translate a frame by a displacement definined outside the frame.

setOrientation : Quaternion -> Frame -> Frame

Set the orientation of a frame.

intrinsicRotate : Quaternion -> Frame -> Frame

Rotate a frame by a rotation defined within the frame.

extrinsicRotate : Quaternion -> Frame -> Frame

Rotate a frame by a rotation defined outside the frame.

Interop

encode : Frame -> Json.Encode.Value

Convert a frame into a Json Value.

decode : Json.Decode.Decoder Frame

A Json Decoder for frames encoded with encode.

toMat4 : Frame -> Math.Matrix4.Mat4

Convert to an elm-linear-algebra Mat4