0
votes

I want to calculate the intersection points of two curves arcs described by mathematical ellipses. Ellipses are based on fitted points 1 and described with:

vertex (main-axis), theta (angle of rotation) , a (y-scale factor)

How can I calculate the intersection of the eclipse parts? Implementation will be done in Matlab and C++.

enter image description here Ellipse Fitting

Based on Source 1, the ellipse is calculated as following in matlab:

//Calculates ellipse based on provided xy data [vertex,theta,a] = myfit(xdata,ydata);

plot(xdata,ydata,'k.','linewidth', 3);
hold on 
drawParabola([vertex(1) vertex(2) a -theta],'Color', colorstring(i), 'linewidth', 1)

The Source Code can be found here: Dropbox Matlab Files

1

1 Answers

0
votes

Write general equations

A1 * x^2 + 2 * B1 * x * y + C1 * y^2 + D1 * x + E1 * y + F1  = 0
A2 * x^2 + 2 * B2 * x * y + C2 * y^2 + D2 * x + E2 * y + F2  = 0

for both ellipses and solve this equation system for x and y (I'm sure that Matlab knows the way). You'll get up to four solutions (there are possible 4 intersection points)