(pos Point, ta, tb, dira, dirb float64, tangent, same bool)
| 145 | } |
| 146 | |
| 147 | func (zs Intersections) add(pos Point, ta, tb, dira, dirb float64, tangent, same bool) Intersections { |
| 148 | // normalise T values between [0,1] |
| 149 | if ta < 0.0 { |
| 150 | ta = 0.0 |
| 151 | } else if 1.0 <= ta { |
| 152 | ta = 1.0 |
| 153 | } |
| 154 | if tb < 0.0 { |
| 155 | tb = 0.0 |
| 156 | } else if 1.0 < tb { |
| 157 | tb = 1.0 |
| 158 | } |
| 159 | return append(zs, Intersection{pos, [2]float64{ta, tb}, [2]float64{dira, dirb}, tangent, same}) |
| 160 | } |
| 161 | |
| 162 | func correctIntersection(z, aMin, aMax, bMin, bMax Point) Point { |
| 163 | if z.X < aMin.X { |
no outgoing calls
no test coverage detected