POV-Ray : Newsgroups : povray.general : Ellipse Server Time
31 Oct 2024 23:32:42 EDT (-0400)
  Ellipse (Message 1 to 3 of 3)  
From: Jon S  Berndt
Subject: Ellipse
Date: 20 Dec 1999 14:23:22
Message: <385e822a@news.povray.org>
This may be a little OT, and I am embarrassed at having to ask this, but I
can't seem to find an equation that will allow me to draw an ellipse
(CENTERED ON THE ORIGIN) by stepping through an angle A. Given the x and y
axis radii, a and b, I want to start at zero angle and calculate a radius
measurement R (FROM THE ORIGIN) for that angle. My thinking is that I will
actually need to calculate x and y coordinates of the point on the ellipse
for the angle A, then take the square root of the sum of the squares of a
and b (did you follow that??). The angle A will step at some given interval,
say 5 degrees, all the way around the horn to 360. Eshabach's Handbook of
Engineering Fundamentals says the parametric form is:

y = b*sin(A)
x = a*cos(A)

My own scribblings got me to:

y = a*sin^2(A)
x = b*cos^2(A)

Anyone have any suggestions?

Jon


Post a reply to this message

From: Adam Coffman
Subject: Re: Ellipse
Date: 20 Dec 1999 14:43:23
Message: <385E86DB.E541CDEE@ipfw.edu>
I think you're looking for a function of the angle A like this.

Radius = r = sqrt(x^2+y^2)

           = sqrt( (a*cos(A))^2 + (b*sin(A))^2 )



The sqrt(x^2+y^2), which you mentioned in your post, is the
"rectangular to polar conversion formula," AKA the Pythagorean
theorem.

The sqrt((a*cos(A))^2+(b*sin(A))^2) is just plugging the parametric
formulas (x = ..., and y = ...) into the first formula.

it could also be expanded a little into:

r = sqrt( a^2 * cos(A)^2 + b^2 * sin(A)^2 )


Adam C....

"Jon S. Berndt" wrote:

> This may be a little OT, and I am embarrassed at having to ask this, but I
> can't seem to find an equation that will allow me to draw an ellipse
> (CENTERED ON THE ORIGIN) by stepping through an angle A. Given the x and y
> axis radii, a and b, I want to start at zero angle and calculate a radius
> measurement R (FROM THE ORIGIN) for that angle. My thinking is that I will
> actually need to calculate x and y coordinates of the point on the ellipse
> for the angle A, then take the square root of the sum of the squares of a
> and b (did you follow that??). The angle A will step at some given interval,
> say 5 degrees, all the way around the horn to 360. Eshabach's Handbook of
> Engineering Fundamentals says the parametric form is:
>
> y = b*sin(A)
> x = a*cos(A)
>
> My own scribblings got me to:
>
> y = a*sin^2(A)
> x = b*cos^2(A)
>
> Anyone have any suggestions?
>
> Jon


Post a reply to this message

From: Ralf Muschall
Subject: Re: Ellipse
Date: 4 Jan 2000 19:06:49
Message: <38728A45.C07295D@t-online.de>
Jon S. Berndt wrote:

> can't seem to find an equation that will allow me to draw an ellipse
> (CENTERED ON THE ORIGIN) by stepping through an angle A. Given the x and y
> axis radii, a and b, I want to start at zero angle and calculate a radius
> measurement R (FROM THE ORIGIN) for that angle. My thinking is that I will

> y = b*sin(A)
> x = a*cos(A)

This is an ellipse, but A is not the angle, but some unspecified
parameter (which nevertheless runs from 0 to 2pi).
The angle can be computed after this with the equation
phi = atan2(y,x)
if you need it (if your computing environment does not know
the function atan2, you will have to emulate it using atan(y/x)
and manual sign manipulation/constant addition).

> y = a*sin^2(A)
> x = b*cos^2(A)

This is a straight line (irrespective of what A stands for).

Ralf


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.