Returns a new vector with z value equal to the second parameter, along the line between this vector and the passed in vector, or null if not possible.
(Vec3 vec, double z)
| 180 | * passed in vector, or null if not possible. |
| 181 | */ |
| 182 | public Vec3 getIntermediateWithZValue(Vec3 vec, double z) |
| 183 | { |
| 184 | double d0 = vec.xCoord - this.xCoord; |
| 185 | double d1 = vec.yCoord - this.yCoord; |
| 186 | double d2 = vec.zCoord - this.zCoord; |
| 187 | |
| 188 | if (d2 * d2 < 1.0000000116860974E-7D) |
| 189 | { |
| 190 | return null; |
| 191 | } |
| 192 | else |
| 193 | { |
| 194 | double d3 = (z - this.zCoord) / d2; |
| 195 | return d3 >= 0.0D && d3 <= 1.0D ? new Vec3(this.xCoord + d0 * d3, this.yCoord + d1 * d3, this.zCoord + d2 * d3) : null; |
| 196 | } |
| 197 | } |
| 198 | |
| 199 | public String toString() |
| 200 | { |
no outgoing calls
no test coverage detected