An ellipse with semiaxes a and b is specified by If r = a = b, then this defines
ID: 2990108 • Letter: A
Question
An ellipse with semiaxes a and b is specified by If r = a = b, then this defines a circle whose perimeter is given by Unfortunately,Explanation / Answer
function [L,Lan] = ellipsearc(a,b,t1,t2) % % ELLIPSEARC computes the arc length of an ellipse of equation: % % x(t) = a.cos(t) % y(t) = b.sin(t) % % between angles t1 and t2 (in radians). The ellipse arc length is % computed numerically by dividing the arc in small straight segments. % % If angles are omitted, the perimeter of the complete ellipse is given. % The second output is the approximated perimeter of the complete ellipse % using the Ramanujan formula % L = pi.( 3.(a+b) - ((3.a+b).(a+3.b))^(1/2) ) % % Examples: % % >> ellipsearc(10,5) % % ans = % % 48.4422 % % >> ellipsearc(10,5,0,pi/3) % % ans = % % 7.0496 % % >> Req=6378.137; % earth radius at equator % >> Rpo=6356.752; % earth radius at pole % >> ellipsearc(Req,Rpo,-pi/2,pi/2) % meridian length % % ans = % % 2.0004e+004 % %arguments if nargin ~= 2 & nargin ~= 4, error('Requires two or four inputs.') return end if nargin == 2, t1=0; t2=pi/2; end %approximated analytical perimeter (Ramanujan) Lan=pi*(3*(a+b)-sqrt((3*a+b)*(a+3*b))); %tests if t2Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.