Rotates the vector around a given arbitrary axis in 3 dimensional space. Rotation will follow the general Right-Hand-Rule, which means rotation will be counterclockwise when the axis is pointing towards the observer. This method will always make sure the provided axis is a unit vector, to n
(@NotNull Vector axis, double angle)
| 516 | * null |
| 517 | */ |
| 518 | @NotNull |
| 519 | public Vector rotateAroundAxis(@NotNull Vector axis, double angle) throws IllegalArgumentException { |
| 520 | Preconditions.checkArgument(axis != null, "The provided axis vector was null"); |
| 521 | |
| 522 | return rotateAroundNonUnitAxis(axis.isNormalized() ? axis : axis.clone().normalize(), angle); |
| 523 | } |
| 524 | |
| 525 | /** |
| 526 | * Rotates the vector around a given arbitrary axis in 3 dimensional space. |