Gets the angle between this vector and another in radians. @param other The other vector @return angle in radians
(@NotNull Vector other)
| 210 | * @return angle in radians |
| 211 | */ |
| 212 | public float angle(@NotNull Vector other) { |
| 213 | double dot = Doubles.constrainToRange(dot(other) / (length() * other.length()), -1.0, 1.0); |
| 214 | |
| 215 | return (float) Math.acos(dot); |
| 216 | } |
| 217 | |
| 218 | /** |
| 219 | * Sets this vector to the midpoint between this vector and another. |