POV-Ray : Newsgroups : povray.general : eliptical confusion. : Re: eliptical confusion. Server Time
10 Aug 2024 07:20:22 EDT (-0400)
  Re: eliptical confusion.  
From: Mike Williams
Date: 15 Feb 2000 02:11:43
Message: <WEUSOcAxtPq4EwaC@econym.demon.co.uk>
Wasn't it Ross Litscher who wrote:
>Hi :)
>
>i have two equations of an ellipse in polar form as follows:
>
>f(theta)=(1-0.01671^2) / (1+0.01671*cos(theta-1.7968))
>
>and
>
>f(theta)=(0.937(1-0.232^2)) / (1+0.232*cos(theta-5.22))
>
>where theta is the angle in radians, that i would like to have pov
>generate the output of by placing a sphere every once in a while. 
>
>these equations are supposed to represent a planet's orbit as well as an
>asteroids orbit. at 2 values for theta, they collide. 
>
>i have never used macros before, but i based my code on one of the
>sample files. i am going to post the resulting image in
>.binaries.images. The source is attached. I know there is a scene-files
>group, but then i'd have all kinds of stuff to spread out. 
>
>basically, there are two problems, the blue path representing the planet
>has strange, nearly flat, sections. The grey path, representing the
>asteroid, has a very uncertain path alltogether :) And furthermore, two
>collision points aren't evident. These are what the whole project is
>about. and i calculated them in a different program. ths whole povray
>stuff is extra. well, i hope someone can enlighten me.

Both problems are due to the fact that POV is inconsistent about the way
it uses angles. The ROTATE operation uses angles measured in degrees,
but its trig functions use angles measured in radians. You used degrees
throughout. 

If you replace both occurrences of "cos(theta..." by "cos(theta/r_d..."
(you've already declared r_d to be 180/Pi) then both orbits become nice
smooth ellipses and the two collision points become clearly visible.

-- 
Mike Williams * ##
Gentleman of Leisure


Post a reply to this message

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