Returns a new vector with y 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 y)
| 159 | * passed in vector, or null if not possible. |
| 160 | */ |
| 161 | public Vec3 getIntermediateWithYValue(Vec3 vec, double y) |
| 162 | { |
| 163 | double d0 = vec.xCoord - this.xCoord; |
| 164 | double d1 = vec.yCoord - this.yCoord; |
| 165 | double d2 = vec.zCoord - this.zCoord; |
| 166 | |
| 167 | if (d1 * d1 < 1.0000000116860974E-7D) |
| 168 | { |
| 169 | return null; |
| 170 | } |
| 171 | else |
| 172 | { |
| 173 | double d3 = (y - this.yCoord) / d1; |
| 174 | return d3 >= 0.0D && d3 <= 1.0D ? new Vec3(this.xCoord + d0 * d3, this.yCoord + d1 * d3, this.zCoord + d2 * d3) : null; |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | /** |
| 179 | * Returns a new vector with z value equal to the second parameter, along the line between this vector and the |
no outgoing calls
no test coverage detected