angle method

double angle(
  1. V2 o
)

Angle between this vector and o in radians.

Returns the signed angle measured from this vector to o, in the range (-π, π].

Implementation

double angle(V2 o) => math.atan2(x*o.y - y*o.x, x*o.x + y*o.y);