POV-Ray : Newsgroups : povray.general : eliptical confusion. Server Time
10 Aug 2024 09:18:33 EDT (-0400)
  eliptical confusion. (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Ross Litscher
Subject: eliptical confusion.
Date: 14 Feb 2000 22:39:01
Message: <38A8CD98.3212F3C0@osu.edu>
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.

thanks,
ross


Post a reply to this message


Attachments:
Download 'us-ascii' (2 KB)

From: Ken
Subject: Re: eliptical confusion.
Date: 14 Feb 2000 23:02:23
Message: <38A8CD97.6A444B11@pacbell.net>
Ross Litscher 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.

If you take a look at the VFAQ under the section "how do I rotate the
camera around the origin" Warp has added a section using sin/cos for
changing a circular path to an elliptical path. Just take the code
from the camera location section and move it into a translate function.
Also instead of using the clock to increment the location use a while
loop to increment the objects position.

http://www.students.tut.fi/~warp/povVFAQ/languageVFAQ.html#camerarotation

-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Ross Litscher
Subject: Re: eliptical confusion.
Date: 14 Feb 2000 23:22:00
Message: <38A8D7AE.1A4CE21D@osu.edu>
Ken wrote:

> If you take a look at the VFAQ under the section "how do I rotate the
> camera around the origin" Warp has added a section using sin/cos for
> changing a circular path to an elliptical path. Just take the code
> from the camera location section and move it into a translate function.
> Also instead of using the clock to increment the location use a while
> loop to increment the objects position.
> 
> 

this seems cleaner, but this doesn't seem as intuitive. I mean, how
exactly does this make things work better? (mind you, i havn't tried
this suggested method yet) The whole idea of a function is that you put
in a value and it returns another value. if these are in fact functions
describing ellipses(i assume they are, they were given and proclaimed
ellipses), then i would assume the output should look like an ellipse.
The blue one *kind of* does, the grey one not at all. 

if there is something wrong with the manner in which I implemeted the
method I chose, could you please explain? i have not used macros before,
and I have never used pov in this (mathematical) way. to me though, it
feels like given a function f(theta), for a value theta the function
returns a distance from the origin. using theta and that returned value,
it should be simple to place a sphere there. 

maybe I am entirely wrong, i'm just a youngin anyway. 

thanks for offering help,
ross


Post a reply to this message

From: Ross Litscher
Subject: Re: eliptical confusion.
Date: 14 Feb 2000 23:52:02
Message: <38A8DEB9.E6097191@osu.edu>
i changed the following:

my_sphere scale to 0.005 instead of .3 (i think it was),
#declare theta = theta + 0.05 for both macros,
and
camera { location <0,1,-2>
	look_at <0,0,0>
	}

this gives a better resolution of what the function is doing, and causes
even more confusion.


dern. looks like I'm not going to bed just yet.


Post a reply to this message

From: Ross Litscher
Subject: Re: eliptical confusion.
Date: 15 Feb 2000 00:21:27
Message: <38A8E59F.F6D551DD@osu.edu>
I don't know why you are right, but you are :]

thanks for the help. I have a very pretty looking plot now of the
emminent destruction of our fair planet


Post a reply to this message

From: Ken
Subject: Re: eliptical confusion.
Date: 15 Feb 2000 01:27:55
Message: <38A8EF96.D2809BAD@pacbell.net>
Ross Litscher wrote:
> 
> I don't know why you are right, but you are :]
> 
> thanks for the help. I have a very pretty looking plot now of the
> emminent destruction of our fair planet

I don't know why it works either but glad to have helped.

-- 
Ken Tyler -  1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/


Post a reply to this message

From: Mike Williams
Subject: Re: eliptical confusion.
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

From: Chris Huff
Subject: Re: eliptical confusion.
Date: 15 Feb 2000 07:22:51
Message: <chrishuff_99-F8138C.07235715022000@news.povray.org>
In article <WEU### [at] econymdemoncouk>, Mike Williams 
<mik### [at] econymdemoncouk> wrote:

> 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.

Alternately, you could use the radians() and degrees() functions to 
convert between the two. This way is easier to understand(when you come 
back to your code later) and doesn't require a variable like "r_d" to be 
declared. These functions are built in to the official POV:

"degrees(A) Convert radians to degrees. Returns the angle measured in 
degrees whose value in radians is A . Formula is  degrees=A/pi*180.0 ."

"radians(A) Convert degrees to radians. Returns the angle measured in 
radians whose value in degrees is A . Formula is  radians=A*pi/180.0."

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Ross Litscher
Subject: Re: eliptical confusion.
Date: 15 Feb 2000 11:34:02
Message: <38A98347.3FCAB042@osu.edu>
Mike Williams wrote:
> 
> 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.
> 


thanks for clearing this up. is there a logical reason for the
inconsistence?


also, thanks chris for pointing out that there are functions for
converting between degrees and radians. 


ross


Post a reply to this message

From: Chris Huff
Subject: Re: eliptical confusion.
Date: 15 Feb 2000 16:19:12
Message: <chrishuff_99-FE0F48.16202315022000@news.povray.org>
In article <38A98347.3FCAB042@osu.edu>, Ross Litscher 
<lit### [at] osuedu> wrote:

> thanks for clearing this up. is there a logical reason for the
> inconsistence?

Probably this: the standard C library uses radians, and the functions 
simply provide a way to access those, but it is easier to manipulate 
objects in degrees. Radians seem to be more common with math, so they 
were kept for the functions.

BTW, I remember seeing a patch which provided degree-based trig 
functions, but I don't remember seeing it in MegaPOV. Which would be 
strange, since it was included in the MultiPatch...
Does anyone know about the status of this patch? I think the author was 
going to separate it from the rest of his patch work, maybe dispersion.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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