0

I'm looking into creating a web application trough witch the user could draw an arbitrary picture on a canvas (only lines involved, no fill and no different colors) and then obtain an equation witch graphs the same picture they've drawn. Does anybody has any idea on witch approach would be the most sensible one?

I thought about simply using Bézier curves to draw and then calculate it's equation, but I wanted to know if there's any other approach which might be more appropriate.

Gark Garcia
  • 450
  • 6
  • 14
  • 2
    Unless you put some very tight restrictions on the allowable curves, there is no way to get an equation from just the curve. As just one example, the curve must represent a single-valued function. – SezMe Apr 26 '18 at 01:11
  • 1
    piece wise cubic interpolation .... so remember the points along the path threshold angular change to obtain the control points and fit bezier through it .... or interpolate see [How can i produce multi point linear interpolation?](https://stackoverflow.com/a/30438865/2521214) especially the link about `Interpolation cubic vs. Bezier cubic` – Spektre Apr 26 '18 at 08:28
  • Thanks @Spektre! That's a great start! – Gark Garcia May 08 '18 at 22:44
  • @SezMe Amazingly, it is actually possible to represent any finite set of ordered pairs as a Cartesian equation (not a function, thought). [This video](https://www.youtube.com/watch?v=0shhLd_JrhA) explains it with some simple, high school level math. – Gark Garcia Jul 13 '18 at 13:50

0 Answers0