Sets the value of this vector to the normalization of vector v1. @param v1 the un-normalized vector
(Vector3d v1)
| 121 | * @param v1 the un-normalized vector |
| 122 | */ |
| 123 | public final void normalize(Vector3d v1) { |
| 124 | double norm; |
| 125 | |
| 126 | norm = 1.0 / Math.sqrt(v1.x * v1.x + v1.y * v1.y + v1.z * v1.z); |
| 127 | this.x = v1.x * norm; |
| 128 | this.y = v1.y * norm; |
| 129 | this.z = v1.z * norm; |
| 130 | } |
| 131 | |
| 132 | |
| 133 | /** |
no test coverage detected