Do argument surgery for times when you don't really know what you are intersecting
circle
Vec2-like and a scalar
Circle2 - obj.position and obj.radius (which may be a function)
segment
- 2
Vec2 like objects
- 2 arrays
x1, y1, x2, y2
line
- 2 scalars (slope + yintercept)
Line2 signature
polygon
It would be really cool if there was a parameterized function exposed by each of these primitives that didn't care what they were. Then intersections and potentially other things become circle.solve(line.equation.bind(line)) where .equation is a function to be called by the circle "solver".
Sounds complicated.
Do argument surgery for times when you don't really know what you are intersecting
circle
Vec2-like and a scalarCircle2-obj.positionandobj.radius(which may be a function)segment
Vec2like objectsx1,y1,x2,y2line
Line2signaturepolygon
obj.pointsVec2-like objects[x,y]It would be really cool if there was a parameterized function exposed by each of these primitives that didn't care what they were. Then intersections and potentially other things become
circle.solve(line.equation.bind(line))where.equationis a function to be called by the circle "solver".Sounds complicated.