I am trying to create gravity for a flight of a ball. The code i am using causes the ball to travel in a more triangular pattern as opposed to a arc. I am trying my best to follow the laws of gravity (for a crossover lesson with physics).
g is a constant value -- 9.8
g is a constant value -- 9.8
Code:
conv = Val(hsbAngle.Value) / 180 * 3.141592654
shpBall.Left = shpBall.Left + Vel * Cos(conv)
If blnDown = False Then
Vel = Vel - g
shpBall.Top = (shpBall.Top - ((Vel) * Sin(conv)))
Else
Vel = Vel + g
shpBall.Top = (shpBall.Top + ((Vel) * Sin(conv)))
End If
If Vel <= 0 Then blnDown = True