Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Quaternion

A Quaternion for 3D rotations.

Hierarchy

  • Quaternion

Index

Constructors

constructor

  • new Quaternion(__namedParameters?: { w?: number; x?: number; y?: number; z?: number }): Quaternion
  • Parameters

    • __namedParameters: { w?: number; x?: number; y?: number; z?: number } = ...
      • Optional w?: number
      • Optional x?: number
      • Optional y?: number
      • Optional z?: number

    Returns Quaternion

Properties

w

w: number

x

x: number

y

y: number

z

z: number

Methods

getAngle

  • getAngle(): number
  • Returns number

    Angle of rotation in radians

getAxis

  • Returns Point3D

    normalized axis of shortest positive rotation

getAzimuth

  • getAzimuth(): number
  • Returns number

    Azimuthal angle of rotation in degrees, also known as the "yaw about 'up'"

getElevation

  • getElevation(): number
  • Returns number

    Elevation angle of rotation in degrees, also known as the "pitch from horizontal plane"

getEulerAngles

  • getEulerAngles(): { pitchDegrees: number; rollDegrees: number; yawDegrees: number }
  • Returns { pitchDegrees: number; rollDegrees: number; yawDegrees: number }

    Euler angle decomposition object: {yaw:, pitch:, roll:} where: yawDegrees = degrees rotation about 'up' axis pitchDegrees = degrees rotation about yawed 'right' axis rollDegrees = degrees rotation about yawed and pitched 'forward' axis

    • pitchDegrees: number
    • rollDegrees: number
    • yawDegrees: number

getPitch

  • getPitch(): number
  • Returns number

    Pitch angle of rotation in degrees, also known as the "elevation"

getYaw

  • getYaw(): number
  • Returns number

    Yaw angle of rotation in degrees, also known as the "azimuth"

normalize

  • normalize(): void
  • Normalize this Quaternion to have unitary length.

    Returns void

rotateVector

Static dot

Static fromAngleAxis

  • Parameters

    • angle: number

      angle of rotation in radians

    • axis: Point3D

      axis of rotation (does not need to be unitary)

    Returns Quaternion

    Quaternion representing a rotation of angle about axis.

Static fromEulerAngles

  • fromEulerAngles(__namedParameters?: { pitchDegrees?: number; rollDegrees?: number; yawDegrees?: number }): Quaternion
  • Parameters

    • __namedParameters: { pitchDegrees?: number; rollDegrees?: number; yawDegrees?: number } = ...
      • Optional pitchDegrees?: number

        angle in degrees rotation about local-right

      • Optional rollDegrees?: number

        angle in degrees rotation about local-forward

      • Optional yawDegrees?: number

        angle in degrees rotation about local-up

    Returns Quaternion

    Quaternion representing a rotation of yaw, pitch, roll about successive local axes: up, right, forward

Static multiply