Closed Pomax closed 8 months ago
E.g.
This should hopefully avoid situations like this:
See the socketless extras
dir, and the Processing flightpath
sketch.
More specifically, see the new getLineCircleIntersection
function in `utils.js:
function getLineCircleIntersection(
{ x, y },
{ x: x1, y: y1 },
{ x: x2, y: y2 },
r
) {
// work relative to (0,0)
x1 -= x;
y1 -= y;
x2 -= x;
y2 -= y;
const dy = y2 - y1;
const dx = x2 - x1;
const m = (dx * dx + dy * dy) ** 0.5;
const A = x1 * y2 - x2 * y1;
const d = (r * r * m * m - A * A) ** 0.5;
return {
x: x + (d * dx + A * dy) / (m * m),
y: y + (d * dy - A * dx) / (m * m),
};
}
this will be covered by the new tutorial, and has been implemented in the improved
branch
Stagger points along the flight path, past a transition, and (lerp-)target those (moving to next point(s) as we pass them), so that we get (back) on the flight path earlier.