nphollon/geo3d/2.0.2

NOTE: this package is not compatible with Elm 0.19.1

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 -> 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.

transformInto (mul a b) vec == transformInto a (transformInto b vec)
compose : Frame -> Frame -> Frame

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

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 -> Value

Convert a frame into a Json Value.

decode : Decoder Frame

A Json Decoder for frames encoded with encode.

toMat4 : Frame -> Mat4