Returns a new vector with x 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 x)
| 138 | * passed in vector, or null if not possible. |
| 139 | */ |
| 140 | public Vec3 getIntermediateWithXValue(Vec3 vec, double x) |
| 141 | { |
| 142 | double d0 = vec.xCoord - this.xCoord; |
| 143 | double d1 = vec.yCoord - this.yCoord; |
| 144 | double d2 = vec.zCoord - this.zCoord; |
| 145 | |
| 146 | if (d0 * d0 < 1.0000000116860974E-7D) |
| 147 | { |
| 148 | return null; |
| 149 | } |
| 150 | else |
| 151 | { |
| 152 | double d3 = (x - this.xCoord) / d0; |
| 153 | return d3 >= 0.0D && d3 <= 1.0D ? new Vec3(this.xCoord + d0 * d3, this.yCoord + d1 * d3, this.zCoord + d2 * d3) : null; |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | /** |
| 158 | * Returns a new vector with y value equal to the second parameter, along the line between this vector and the |
no outgoing calls
no test coverage detected