Pomax / bezierjs

A nodejs and client-side library for (cubic) Bezier curve work
MIT License
1.7k stars 230 forks source link

How to Find Y-Coordinate for a Given X-Coordinate on a Bezier Curve #216

Closed Typogram closed 3 months ago

Typogram commented 3 months ago

Hello, I'm currently working on a project where I need to calculate the y-coordinate of a point on a Bezier curve given an x-coordinate. I understand that Bezier.js provides functionalities such as get(t) to get the point on the curve for a given t parameter, but I'm wondering if it is possible to find the y-coordinate for a specific x-coordinate? Maybe it is hard because there could potentially be two or more y coordinate.

I would greatly appreciate any insights, advice, or references to documentation or examples that could assist me in implementing a solution for this problem.

Pomax commented 3 months ago

https://pomax.github.io/bezierinfo/#yforx =)

Typogram commented 3 months ago

Wow thanks! This is super helpful! I have ran into your comments in various github repo about fonts, it is great to dive into your work!

Pomax commented 3 months ago

always great to hear!