Skip to content

quaternionFromVec3ToVec3

quaternionFromVec3ToVec3(from, to): Quaternion

Defined in: math-linear/src/quaternion.ts:139

Creates the shortest-arc quaternion that rotates from to to. Both vectors must be non-zero; they do not need to be unit-length. Handles the anti-parallel (180°) case by using an arbitrary perpendicular axis.

Vec3

Vec3

Quaternion