POV-Ray : Newsgroups : povray.general : I need math help : Re: I need math help Server Time
6 Aug 2024 14:22:06 EDT (-0400)
  Re: I need math help  
From: chaps
Date: 6 Mar 2002 13:59:18
Message: <3c866706$1@news.povray.org>
Hi Bob,
what I understand is that you want to perform an animation were an object is
going from point A to point B, decelerating to a full stop.

This as an infinite number of solutions. Lets take the simplest path: a
straight path with constant deceleration. in this case the path is given by



were A is acceleration, V is velocity when time is 0, X is position when
time is 0, x is position when time is equal to t.

You give the starting point X and an end point (0 in your example). The
equation show that you still need to define 2 values before being able to
calculate position at any time:
        initial speed and total duration,
or     initial speed and deceleration,
or     deceleration and total duration.

the first case seems to be relevent, that means that we say that initial
speed is V, and total duration is T. In order to be more general, let's say
that at the end (t = T) the position is Xe.


so

it is possible to calculate this constant, and then evaluate at each
animation step:

t = t + T/nbstep


Hope it will help you.

Chaps

"=Bob=" <bob### [at] threestrandscom> wrote in message
news:3c853e1f@news.povray.org...
> I need a formula to slowly adjust one value to
> another value over a known period. For example,
> I have an increment value of 1 and I want that
> value to decrease until it's 0 (or some other
> value as needed, 0 for now). And I must reach
> the known period (length in this case).
>
> So I would be doing something like:
>
> somelen = 62;
> incval = 1;
> someotherval = ?
>
> for (x=0;x<somelen;x+=incval)
>     {
>     incval -= someotherval;
>     if (incval <= 0)
>         break;
>     }
>
> I need x to achieve "somelen" and "incval" to
> achieve the value of 0 at about the same time,
> give or take a bit.
>
> How do I calculate "someotherval" ?
> Thanks for your help.
> =Bob=
>
>
>


Post a reply to this message

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