linearly v0.32.0Docs


linearly v0.32.0 / vec2 / angle

Function: angle()

angle(a, b?): number

Get the angle between two 2D vectors. If the second argument is omitted, it returns a signed angle relative to x axis.

Parameters

a: vec2

The first vector

b?: vec2

The second vector

Returns

number

The angle in degrees. If the angle from a to b is clockwise, the return value is positive. Otherwise, it is negative. The range is (-180, 180].

Defined in

src/vec2.ts:606open in new window