POV-Ray : Newsgroups : povray.general : I need math help : Re: I need math help Server Time
19 Nov 2024 11:44:40 EST (-0500)
  Re: I need math help  
From: Tor Olav Kristensen
Date: 5 Mar 2002 20:34:05
Message: <3C857095.EFBD2FDF@hotmail.com>
=Bob= wrote:
> 
> Hi Tor,
> 
> Thanks for responding. How would I know
> how many steps (NrOfSteps) to use? Or am
> I missing something? What I'm trying to achieve
> is to decrease a value over a known length in
> an unkown number of steps.

E.g.:

If your known length is e.g. 3.14 meter
(i.e. the difference between StartValue
and EndValue equals 3.14) and you want to
decrease the X value for every millimetre,
then just use 3140 steps.

(3.14m = 3140mm)


> Thanks for your help!

You're welcome.


Tor Olav

> "Tor Olav Kristensen" <tor### [at] hotmailcom> wrote in message
news:3C855736.7D202442@hotmail.com...
> 
> [My post deleted]
> 
> : Since you're asking in povray.general,
> : I'll answer with a POV script:
> :
> : #declare StartValue = 31;
> : #declare EndValue = 3;
> : #declare NrOfSteps = 10;
> :
> : #declare dValue = (EndValue - StartValue)/NrOfSteps;
> : #declare Step = 0;
> : #while (Step <= NrOfSteps)
> :   #declare X = StartValue + Step*dValue;
> :   #debug "\n"
> :   #debug str(X, 0, -1)
> :   #declare Step = Step + 1;
> : #end // while
> : #debug "\n"
> :
> : Tor Olav


Post a reply to this message

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