Converts this vector to a unit vector (a vector with length of 1). @return the same vector
()
| 304 | * @return the same vector |
| 305 | */ |
| 306 | public Vector normalize() { |
| 307 | double length = length(); |
| 308 | |
| 309 | x /= length; |
| 310 | y /= length; |
| 311 | z /= length; |
| 312 | |
| 313 | return this; |
| 314 | } |
| 315 | |
| 316 | /** |
| 317 | * Zero this vector's components. |