Reference · Surface maze rules and geometry
quatSlerpfunction
Halfway (or any share) from one rotation to another along the shortest way.
Import it
import { quatSlerp } from "@johnmorrisdotca/meikyuu/3d";
Definition
function quatSlerp(a: Quat, b: Quat, t: number): Quat
Parameters
| Name | Type | Description |
|---|---|---|
a | Quat | The first quaternion or vector specified by the signature. |
b | Quat | The second quaternion or vector specified by the signature. |
t | number | The interpolation share from 0 to 1. |
Returns
Quat
Halfway (or any share) from one rotation to another along the shortest way.
Examples
import type { Quat } from "@johnmorrisdotca/meikyuu/3d";
import { quatAxisAngle, quatSlerp } from "@johnmorrisdotca/meikyuu/3d";
const q: Quat = [0,0,0,1];
console.log(quatSlerp(q,quatAxisAngle([0,1,0],Math.PI/4),0.5));[ 0, 0.19509032201612825, 0, 0.9807852804032302 ]What it prints (run when this page was built)