[net.math] moRe: Conic sections

iau@ukc.UUCP (01/31/86)

Keywords:
Xpath: ukc eagle

Having seen half a dozen replies to the original posting, all giving
information I found in Analytical Geometry textbooks going back 150 years, I
thought I'd try a slight change of direction. So:

Does anyone know (or know where to find) expressions for the coefficients of
the (oft quoted) general second order equation in terms of the radii
($r_{major},r_{minor}$), center ($x_c,y_c$) and rotation ($theta$) of a
circle or ellipse (I'm not interested in the other conics). I've
found/discovered/guessed the forms with center and radii, but when I
try to add rotation, I'm stumped.

I'd tell you why I'm interested in this, but given the recent flames about
what should (or shouldn't) be in this group, I don't think you'd want to
know.

	Ian Utting	iau@ukc.uucp
(From the above, you'll have guessed that I'm no mathematician).

bs@faron.UUCP (Robert D. Silverman) (02/02/86)

> Keywords:
> Xpath: ukc eagle
> 
> Having seen half a dozen replies to the original posting, all giving
> information I found in Analytical Geometry textbooks going back 150 years, I
> thought I'd try a slight change of direction. So:
> 
> Does anyone know (or know where to find) expressions for the coefficients of
> the (oft quoted) general second order equation in terms of the radii
> ($r_{major},r_{minor}$), center ($x_c,y_c$) and rotation ($theta$) of a
> circle or ellipse (I'm not interested in the other conics). I've
> found/discovered/guessed the forms with center and radii, but when I
> try to add rotation, I'm stumped.
> 
> I'd tell you why I'm interested in this, but given the recent flames about
> what should (or shouldn't) be in this group, I don't think you'd want to
> know.
> 
> 	Ian Utting	iau@ukc.uucp
> (From the above, you'll have guessed that I'm no mathematician).

One removes the linear terms in x any y by translation: completing the
square allows one to transform x' = x + a  and y' = y + b. To rotate
by an angle theta add a Bxy term where

	tan(2 theta) = B/(A-C)

Bob Silverman

jp@lanl.ARPA (02/02/86)

I am not sure why you care about the rotation of a circle, but I have
implemented an algorithm for plotting circles and ellipses with arbitrary
starting angles.  A good way to see how to do this is to look at the
matrix equations:

x(theta) -x_c        cos(theta)     e sin(theta) |   r cos(phi)
                =  |                             |
y(theta) - y_c     | e^-1 sin(theta)  cos(theta) |   r sin(phi)

This yields essentiall parametric equations for the circle (e=1) or
ellipse whose major axis (if e > 1) makes an angle phi with the x axis.
I choose a small value for theta and by successive multiplications plot
out a circle.  If theta =360/1000 there will be 1000 points on the circle/
ellipse.  I make the size of the angle inversely proportional to r to keep
a reasonable point density.  If the rotation matrix has sufficiently accurate
values for the trig functions and multiplication is reasonably precise the 
figure will hold together for angles much larger than 360 degrees.  As
a test a made a 1000 point circle and went around it 10 times, that's 10000
multiplications and the end point was within 1 half pixel (actually better -
I just don't remember how close) on a 4096 X 3072 display.  Oh,yes the
calculations were done with an 80287 math coprocessor.  
Don't really know if this is in anyway related to your problem and it's not
a very highbrow math problem, but maybe someone is interested.

Jim Potter  jp@lanl.arpa