math - Easiest way to compute a point inside of two arcs (doughnut segment) -


i need general solution. here specific example. have svg path defined d="m239.9,254.0a113.7,113.7,0,0,0,322.5,289.7l322.4,341.9a166,166,0,0,1,201.8,289.9z"

or using m x0 y0 r1 r2 0 larc sweep x1 y1 l x2 y2 r3 r4 0 larc sweep x3 y3

x0=239.9 y0=254.0  x1=322.5 y1=289.7 

are end points of inner arc , since r1=r2=113.7 circle. since larc=0 angle between 2 points less 180 degrees. sweep=0 means arc drawn counterclockwise.

x2=322.4 y2=341.9  x3=201.8 y3=289.9 

are end points of outer arc , since r3=r4=166 circle. since larc=0 angle between 2 points less 180 degrees. sweep=1 means arc drawn clockwise.

i compute midpoint of 2 of endpoints e.g. xm=(x3+x2)/2 ym=(y3+x2)/2 rounding error put point outside doughnut segment.

i know how compute midpoints of each arc , compute midpoint between 2 arc midpoints lot of equations. there simpler way? need point inside doughnut. remember larc (large-arc) = 1 angles greater 180.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -