Converts this vector to a unit vector (a vector with length of 1). @return the same vector
()
| 349 | * @return the same vector |
| 350 | */ |
| 351 | @NotNull |
| 352 | public Vector normalize() { |
| 353 | double length = length(); |
| 354 | |
| 355 | x /= length; |
| 356 | y /= length; |
| 357 | z /= length; |
| 358 | |
| 359 | return this; |
| 360 | } |
| 361 | |
| 362 | /** |
| 363 | * Zero this vector's components. |