defining a closed curve in cartesian coordinates

141 Views Asked by At

I am trying to implement a track in cartesian coordinates, such that X and Y coordinates are accepted and those are linearly interpolated.

The problem is, I want to include circular shapes on corners instead of sharp corners and I can include many points to make it smooth circle like (but actually n-gon). Is there an easy way to find those points? (or should I get all by (x-a)^2+(y-b)^2=r^2). Dividing every circular arc around 100 points should be smooth enough for my application.

I am attaching a sample drawing that I basically know the points from A to K; but I would like to generate the points on the circular arcs as well.

enter image description here

1

There are 1 best solutions below

0
On

Hint:

The easiest way to parametrize a circle is using $$t\mapsto (\cos t, \sin t)$$

If you let $t$ go from $0$ to $2\pi$, the curve $(\cos t, \sin t)$ covers the whole circle. Not only that, but if $t_1,t_2,t_3\dots,t_n\in [0,2\pi]$ are equidistant, then the points belonging to them on the curve are also equidistant.