Well, the easy answer to controlling the speed is to adjust the value of gravity. Making it smaller will make things happen slower. (If you wanted more accurate time control, you\'d need to add a timer function into the loop - but that get\'s a bit more complicated.)
Quote: "could you post the whole set of equations? "
Well, you have most of them already ......
Initial vertical velocity: vy#=v#*sin(angle#)
Initial horizontal velocity: vx#=v#*cos(angle#)
Time of flight: tof#=2*vy#/g#
Range: range#=vx#*tof#
Required initial velocity to hit target: v#=sqrt((g#*range#)/(sin(2*angle#)))
Max height: height#=((vy#)^2)/(2*g#)
If you wanted to get a little more involved with your projectiles, and start adding variables such as lift, air resistance, headwind, crosswind, bounce etc. then you can check out this code I wrote a while back - you can change the trajectory using the arrow keys, and all the other variables in the code:
`Projectile simulation by Ric.
Rem Created: 31/07/2004 04:10:01
sync on
hide mouse
`make ball
make object sphere 1,3
`make launcher
make object box 2,24,4,4
position camera 0,200,140,-300
`restart point
restart:
undim xs(0)
undim ys(0)
n=0
`define variables
`number of bounces
bounce=0 `leave this alone
`position of ball x,y,z
x#=0
y#=0
z#=0
`resultant velocity of ball
v#=1.2 `set this to whatever you like, and
`adjust camera position accordingly.
`velocity x,y,z - leave these alone
vx#=0
vy#=0
vz#=0
`acceleration x,y,z
ax#=0.0 `(deceleration due to air resistance - LEAVE AT ZERO)
ay#=0.004 `(deceleration due to gravity)
az#=0.0 `(acceleration due to cross wind/hook/slice.
` Set - for right, + for left, between 0 and about 0.01)
`lift amount
lift#=0.02 `set bigger for more backspin,
`lower for less backspin - use small values (like 0.02)
`air resistance
ar#=0.003 `(set between 0 and about 0.003 - too much and weird things happen!)
`headwind/trailing wind
hw#=0.0 `(0.001 would be a pretty strong headwind. Negative values for trailing wind)
`intitial trajectory
traj#=25 `leave this alone - control this using arrow keys in the program
`set initial positions
position object 1,0,0,0
position object 2,0,0,0
`main loop
do
`set trajectory of ball using arrow keys
if upkey()=1 then traj#=traj#+1
if downkey()=1 then traj#=traj#-1
zrotate object 2, traj#+10
`apply trajectory to initial velocity
vx#=v#*cos(traj#) `(horizontal velocity)
vy#=v#*sin(traj#) `(vertical velocity)
`check for ball being launched
if spacekey()=1 then gosub hitball
sync
loop
hitball:
do
x#=x#+vx# `increase x position by velocity amount
ax#=vx#*ar# `deceleration is proportional to air resistance
vx#=vx#-ax# `decrease velocity by deceleration amount due to air res.
vx#=vx#-hw# `and decrease it by deceleration amount due to headwind.
y#=y#+vy# `increase y position by velocity amount
vy#=vy#-ay# `decrease velocity by deceleration due to gravity
vy#=vy#+lift# `increase vertical velocity by lift amount
lift#=lift#*0.95 `decrease lift exponentially
z#=z#+vz# `change z position by velocity amount
vz#=vz#+az# `increase velocity by acceleration due to crosswind/slice/hook
`move ball
position object 1,x#,y#,z#
`leave trail of dots
dim xs(n)
dim ys(n)
xs(n)=(object screen X(1))
ys(n)=(object screen Y(1))
for d=0 to n
dx=(xs(d))
dy=(ys(d))
dot dx,dy
next d
n=n+1
`bounce when ball hits the ground
if y#<0
y#=1
vy#=vy#*-0.4 `increase for harder surface, decrease for soft surface
bounce=bounce+1
if bounce>5 then goto restart
endif
sync
loop