MATLAB: Perimeter of a part of an ellipse

perimeter of a part of an ellipseperimeter of ellipse

I know the ellipse(center of ellipse,length of semi-axes,orientation).I also know the co-ordinates of two points which comprise the end points of the curve which is a part of the given ellipse.How can I find out the perimeter of this part of an ellipse??

Best Answer

Sibananda
If you already have a and b, then you don't really need the ellipse centre point, or the ellipse tilt angle.
The points of the ellipse have a unique angle, let's say the pair of points you want to measure the section of perimeter in between are
p1: angle1
p2: angle2
then the length you are after
L=perim_ellipse(angle1,a,b)-perim_ellipse(angle2,a,b)
where perim_ellipse is a function that calculates the perimeter length from 0 to angle.
If you really know it's an ellipse, or what's the same: you can afford neglecting the approximation error then you don't really need the parametric representation of the ellipse and you may <http://mathworld.wolfram.com/Ellipse.html>
Perimeter=a*E(t,sqrt(1-b^2/a^2))
should coincide with
b*E(t,sqrt(1-a^2/b^2))
where E(t,k) is an elliptic integral
for instance
a=1
b=2
k1=sqrt(1-b^2/a^2)
fun1=@(angle) sqrt(1-k1^2*(sin(angle)).^2)
E1=integral(fun1,0,2*pi)
E1 =
9.688448220547675
k2=sqrt(1-a^2/b^2)
fun2=@(angle) sqrt(1-k2^2*(sin(angle)).^2)
E2=integral(fun2,0,2*pi)
E2 =
4.844224110273838
and
E1/E2
=
2
2.- go straight to the S.Ramanujan 2nd approximation:
a=1;b=2; % for instance
h=(a-b)^2/(a+b)^2
h =
0.111111111111111
Perimeter=pi*(a+b)*(1+3*h/(10+(4-3*h)))
Perimeter =
9.654650593958877
E1-Perimeter
=
0.033797626588798
more approximations here:
2.- if you actually have the points, then is when the parametric formulation of the ellipse can be integrated,
Centring and removing tilt the parametric equations of an ellipse with axes a and be are:
t=[0:.01:2*pi]
x=a*cos(t)
y=b*sin(t)
L=[x;y];
perimeter=0;
for k=2:1:length(t)
perimeter=perimeter+dist1(L(:,k-1),L(:,k));
end
perimeter =
9.682037252420420
So,
function L1=perim_ellipse(t1,a,b)
% t1 angle in radian of ellipse point
% a,b: ellipse absolute minor and major axes, without tilt, in any order
t=[0:.01:t1];
x=a*cos(t);
y=b*sin(t);
ellipse_points=[x;y];
L1=0;
for k=2:1:length(t)
L1=L1+dist1(ellipse_points(:,k-1),ellipse_points(:,k));
end
end
checking
format long;
L0=perim_ellipse(2*pi,1,2);
L0 =
9.682037252420420
So, to calculate the arc length you asked, of let's say angle1=45º and angle2=135º:
angle1=pi/4;
angle2=3*pi/4;
a=1;b=2;
L12=abs(perim_ellipse(angle1,a,b)-perim_ellipse(angle2,a,b))
L12 =
1.930084466978536
If you find this answer of any help solving your question,
please click on the thumbs-up vote link, or mark this answer as accepted
thanks in advance
John