A83: Re: trajectory...


[Prev][Next][Index][Thread]

A83: Re: trajectory...




hmmm
i figured out today a helluva lot easier way that i've been doin it.
i'm just saying the hell with air resistance and going:

x coord= velocity * cos angle * time
y coord= (velocity * sin angle * time) - gravity * time ^2 * .5
which are the equations for distance
i'm just parsing equations set in the Y-vars and storing the result as x and
y. Then i just divide them by 10 and round them.

i increase the time by 0.1s every loop( by makin a YVAR = T+.1 and parsin
it)  it worked perfectly in basic and it's workin in asm, (i'm just workin
on it gettin to display the pixels right now).

Oh yeah how would i set an equation from within the prog?
cuz right now i'm stickin them in manually b4 i run the prog.

Oh yeah and i'm using the SI units. (meters, m/s,etc)

-----Original Message-----
From: Phelan Wolf <phelanwolf@hotmail.com>
To: assembly-83@lists.ticalc.org <assembly-83@lists.ticalc.org>
Date: Sunday, October 18, 1998 9:19 PM
Subject: A83: trajectory...


>
>I was thinking that it would go something like this...
>;in pusedo code
>;X = x coord
>;Y = y coord
>;G = gravity mult, Y*G = highest point on arc
>;D = Drag in CM per Second
>;S = CM per Second
>;each X coord is 1cm from the other, so this is one helluva slow
>;object.
>start:
> push S
>loop1:
> inc X
> dec S
> If S(/=)0
> Goto loop1
> inc Y
> If Y=Y*G
> Goto fallingDown
> Goto DispSpriteAtXY
>DispSpriteAtXY:
>;code for displayer sprite
> goto loop1
>DispSpriteAtXY2:
>;code for displaying sprite
> goto loop2
>fallingDown:
> push S
>loop2:
> If S-D(/=)0
> inc X
> dec Y
> If Y=0
> Goto End
> Goto DispSpriteAtXY2
>End:
> pop S
> ret
>
>AM NOT SURE BUT IT SHOULD GIVE YOU AN ARC IF I DID IT RIGHT...
>-Phelan 'Amen' Wolf
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com
>