Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: circumference of an ellipse

  • To: mathgroup at smc.vnet.net
  • Subject: [mg19292] Re: circumference of an ellipse
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Sat, 14 Aug 1999 01:45:16 -0400
  • References: <7p017c$778@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Marcel,

circumference[a_, b_] :=
  Integrate[Sqrt[D[a Cos[t], t]^2 + D[b Sin[t], t]^2], {t, 0, 2Pi}]

Check:

circumference[1, 1]

2 Pi

N[circumference[2, 1], 30]

9.68844822054767619842850319639

N[circumference[5, 1], 30]

21.0100445396890009446991645885

N[circumference[100, 20], 30]

420.200890793780018893983291769

The above computes an exact symbolic value which is then approximatied to 30
places by N[--,30]
Immediate numerical integration may be sufficient for your needs and is
probably quicker.

Ncircumference[a_, b_] := NIntegrate[
    Evaluate[Sqrt[D[a Cos[t], t]^2 + D[b Sin[t], t]^2]], {t, 0, 2Pi // N}]

Ncircumference[2, 1]

9.68845

Ncircumference[5, 1]

21.01

Ncircumference[100, 20]

420.201

If you use this a lot you might make an interpolating function.



Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

M.J.M. Maes <mar.maes at wxs.nl> wrote in message
news:7p017c$778 at smc.vnet.net...
> I made a little spreadsheetfile to calculate the circumference (length) of
> an ellipse using an iterative process.
> When I compare the results with the results of a formula to approximate
the
> lenght
>  - which is pi(3(a+b)-sqrt((a+3b)(3a+b))) - the difference is greater then
I
> expected (a few percents).
> This may be a shortcoming of the approximation formula, or of my
> worksheetformulae.
> Could someone please give me the exact results (in 10 or 15 digits) of
some
> examples?
> a=2; b=1
> a=5; b=1
> a=100; b=26
>
> Thanks in advance!
>
> Marcel
>
>
>




  • Prev by Date: Re: Gaussian PDF Overlay
  • Next by Date: Re: Simple? 3D Plotting Problems
  • Previous by thread: Re: circumference of an ellipse
  • Next by thread: Re: circumference of an ellipse