Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/gmath/src/quaternion.ts>Quaternion

🎮 A wasm accelerated game and graphics maths library for deno
Latest
class Quaternion
import { Quaternion } from "https://deno.land/x/gmath@0.1.12/src/quaternion.ts";

Constructors

new
Quaternion()
new
Quaternion(scalar: number, vector: Vector3)
new
Quaternion(scalar?: number, vector?: Vector3)

Properties

scalar: number
vector: Vector3

Methods

add(other: Quaternion | number): Quaternion

Creates a new Quaternion with the same values

div(other: number): Quaternion
dot(other: Quaternion): number
eq(other: Quaternion): boolean
is_finite(): boolean
mag(): number
mag2(): number
mul(other: Quaternion | number): Quaternion
nlerp(other: Quaternion, alpha: number): Quaternion
rot(vector: Vector3): Vector3
set(scalar: number, vector: Vector3): Quaternion
slerp(other: Quaternion, alpha: number): Quaternion
sub(other: Quaternion | number): Quaternion
toString(): string