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