Skip to main content

get-interface-rotation

function getInterfaceRotation(a: number[], b: number[]): number

Defined in simultaneous-properties/get-interface-rotation.ts:26

Returns the rotation angle (-𝜋 <= θ <= 𝜋 guaranteed) from some vector to another vector considering them to both start at the same point.

If one of the vectors is the zero vector then 0 is returned.

It can also be imagined that the 2nd vector starts where the 1st one ends.

Intermediate calculations are done in double precision in a numerically stable manner.

Parameters:

NameTypeDescription
anumber[]the first 2d vector given as [x,y] where x and y are the coordinates, e.g. [2,3]
bnumber[]the second 2d vector