Converts this vector to a unit vector (a vector with length of 1). @return the same vector
()
| 342 | * @return the same vector |
| 343 | */ |
| 344 | @NotNull |
| 345 | public Vector normalize() { |
| 346 | double length = length(); |
| 347 | |
| 348 | x /= length; |
| 349 | y /= length; |
| 350 | z /= length; |
| 351 | |
| 352 | return this; |
| 353 | } |
| 354 | |
| 355 | /** |
| 356 | * Zero this vector's components. |
no test coverage detected