2

I have multiple curved lines on my Canvas (drawn with the beginShape/curvedVertex methods). These lines may intersect at one or more points. I’d like to find the coordinates of any intersections so that I can add them to an array. Does anyone know how I can approach this?

BlakeS
  • 41
  • 1

1 Answers1

0

In my opinion, this question is more about mathematics. In computer programs, graphs are drawn using too many points. For example, if the real intersection is sqrt(2), It will be impossible to find intersection using points. Many solutions are provided by mathematicians. One of the best ones: If the graphs are known as continuous, find 2 points x and y such that £: f(x)>g(x) and ¥: f(y)<g(y). So the intersection is in [x,y]. Replace one of x and y with (x+y)/2 such that £ and ¥ expressions hold. In this way, you will reach as near as you need, to the intersection by iterating this algorithm.

Parsa Dany
  • 35
  • 3