Return the angle between this vector and the supplied vector. @param v the other vector @return the angle, in radians
(Vec2 v)
| 549 | * @return the angle, in radians |
| 550 | */ |
| 551 | public double angle(Vec2 v) { |
| 552 | double dot = x * v.x + y * v.y; |
| 553 | double det = x * v.y - y * v.x; |
| 554 | return Math.atan2(det, dot); |
| 555 | } |
| 556 | |
| 557 | /** |
| 558 | * Return the length of this vector. |