Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

another (simpler) inflection calculation #397

Open
kanou-h opened this issue Oct 30, 2024 · 0 comments
Open

another (simpler) inflection calculation #397

kanou-h opened this issue Oct 30, 2024 · 0 comments

Comments

@kanou-h
Copy link

kanou-h commented Oct 30, 2024

We can calculate the inflection of a cubic Bezier curve defined by (P0, P1, P2, P3) without aligning it:

Define vector variables
V0 = P1 - P0, V1 = P2 - P1, V2 = P3 - P2,
A0 = V1 - V0, A1 = V2 - V1
and cross product P×Q as
cross(P, Q) = P.x * Q.y - P.y * Q.x,
then the coefficients of quadratic equation
a * t*t + b * t + c = 0
can be expressed as
a = cross(A1, A0),
c = cross(V1, V0),
b = cross(V2, V0) - 2 * c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant