POV-Ray : Newsgroups : povray.general : I have a.... Server Time
6 Aug 2024 04:24:29 EDT (-0400)
  I have a.... (Message 1 to 6 of 6)  
From: James Taylor
Subject: I have a....
Date: 23 Jun 2002 20:08:23
Message: <3d1662f7@news.povray.org>
...problem that's driving me mental, cos the solution is going to be so
simple, but at the moment I just can't see it. :(

I'm trying to create a helix using a sphere_sweep and I'm missing
something - my limited maths tells me the points for a helix which extends
along the x-axis should be:
    #declare value = 2*pi*i/N;
    <pitch*i,sin(value),tan(value)/sin(value)>
where N is the number of points in the sphere_sweep and i is incremented in
a while-loop
-but its just plain wrong.

can someone steer me in the right direction?

thanks in advance
jim


Post a reply to this message

From: Christopher James Huff
Subject: Re: I have a....
Date: 23 Jun 2002 20:25:07
Message: <pan.2002.06.23.19.24.41.392936.635@mac.com>
On Sun, 23 Jun 2002 20:01:51 -0500, James Taylor wrote:

> ...problem that's driving me mental, cos the solution is going to be so
> simple, but at the moment I just can't see it. :(
> 
> I'm trying to create a helix using a sphere_sweep and I'm missing
> something - my limited maths tells me the points for a helix which
> extends along the x-axis should be:
>     #declare value = 2*pi*i/N;
>     <pitch*i,sin(value),tan(value)/sin(value)>
> where N is the number of points in the sphere_sweep and i is incremented
> in a while-loop
> -but its just plain wrong.

You're making it too hard. No need to mess with trigonometry here, just
use the vrotate() function (assuming I goes from 0 to N-1): vrotate(<
helixLength*I/(N-1), helixRadius, 0>, x*360*helixLoops*I/(N-1))

BTW, the usual solution using trig functions uses sin() and cos(). Oh, and
notice I capitalized the counter variable...it is a good idea to use at
least one capital letter in variable names to avoid conflict with future
POV features. Reserved words will always be lowercase, so using a capital
avoids that problem.

-- 
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: <chr### [at] tagpovrayorg>
WWW: http://homepage.mac.com/chrishuff/


Post a reply to this message

From: James Taylor
Subject: Re: I have a....
Date: 23 Jun 2002 20:35:17
Message: <3d166945@news.povray.org>
"Christopher James Huff" <chr### [at] maccom> wrote in message
> BTW, the usual solution using trig functions uses sin() and cos().

if I remember right, tan()/sin() is cos()...

Thanks for the solution - it seems pretty logical now.

jim


Post a reply to this message

From: Mike Williams
Subject: Re: I have a....
Date: 24 Jun 2002 00:01:45
Message: <qLTxPBAfmpF9EwxJ@econym.demon.co.uk>
Wasn't it James Taylor who wrote:
>"Christopher James Huff" <chr### [at] maccom> wrote in message
>> BTW, the usual solution using trig functions uses sin() and cos().
>
>if I remember right, tan()/sin() is cos()...

I always thought that sin()/tan() was cos().

  sin() = opposite/hypotenuse
  tan() = opposite/adjacent
  cos() = adjacent/hypotenuse

So sin()/tan(() = (o/h)/(o/a) = a/h = cos()

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: N Shomber
Subject: Re: I have a....
Date: 24 Jun 2002 11:29:03
Message: <3d173abf$1@news.povray.org>
> if I remember right, tan()/sin() is cos()...

I believe:

sin()=opposite/hypotenuse
cos()=adjacent/hypotenuse
tan()=opposite/adjacent
csc()=hypotenuse/opposite
sec()=hypotenuse/adjacent
cot()=adjacent/opposite

and:
1/sin()=csc()
1/cos()=sec()
1/tan()=cot()
sin^2()+cos^2()=1
tan^2()+1=sec^2()
1+cot^2()=csc^2()

> if I remember right, tan()/sin() is cos()...

tan()=o/a
sin()=o/h
tan()/sin()=(o/a)/(o/h)
=(1/a)/(1/h)
=(h/a)
=sec()

Just a clarification.

N Shomber


Post a reply to this message

From: Slime
Subject: Re: I have a....
Date: 24 Jun 2002 17:55:04
Message: <3d179538@news.povray.org>
> if I remember right, tan()/sin() is cos()...

As others have pointed out, it's actually 1/cos(), or sec().
(sin()/cos())/sin() = sin()/(cos()*sin()) = 1/cos())

Now, even if you had correctly used sin()/tan(), you would have still had
problems at the points where tan() is zero (since division by zero is
undefined) and where it's undefined (at pi/2 + n*pi). Every other point
would have turned out correct, but you probably would have had errors
nonetheless.

 - Slime
[ http://www.slimeland.com/ ]


Post a reply to this message

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