(vec: Vec2)
| 75 | return Math.atan2(this.cross(vec), this.dot(vec)); |
| 76 | } |
| 77 | cosineTo(vec: Vec2) { |
| 78 | const dotProduct = this.dot(vec); |
| 79 | const magnitudeProduct = this.length() * vec.length(); |
| 80 | return dotProduct / magnitudeProduct; |
| 81 | } |
| 82 | rotate(angle: number): Vec2 { |
| 83 | const cos = Math.cos(angle); |
| 84 | const sin = Math.sin(angle); |