Normalizes the vector to a length of 1 (except if it is the zero vector)
()
| 52 | * Normalizes the vector to a length of 1 (except if it is the zero vector) |
| 53 | */ |
| 54 | public Vec3 normalize() |
| 55 | { |
| 56 | double d0 = MathHelper.sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord); |
| 57 | return d0 < 1.0E-4D ? new Vec3(0.0D, 0.0D, 0.0D) : new Vec3(this.xCoord / d0, this.yCoord / d0, this.zCoord / d0); |
| 58 | } |
| 59 | |
| 60 | public double dotProduct(Vec3 vec) |
| 61 | { |
no test coverage detected