Gets the angle between this vector and another in radians. @param other The other vector @return angle in radians
(@NotNull Vector other)
| 203 | * @return angle in radians |
| 204 | */ |
| 205 | public float angle(@NotNull Vector other) { |
| 206 | double dot = Doubles.constrainToRange(dot(other) / (length() * other.length()), -1.0, 1.0); |
| 207 | |
| 208 | return (float) Math.acos(dot); |
| 209 | } |
| 210 | |
| 211 | /** |
| 212 | * Sets this vector to the midpoint between this vector and another. |