11-22-2003, 11:25 PM
Yea.... I made this hangtime calculator a while ago. I thought that someone might want to use my formulas, so I'm gonna release the source. All I did was use formulas, so you can edit it as you see fit easily. Here ya go.
Code:
DIM T AS INTEGER
CLS
PRINT "Hangtime Calculator"
PRINT "By: Dan Kogge"
INPUT "Velocity?(M/S) ", V
INPUT "Angle?(Degrees) ", A
A = A * (3.141592653589793# / 180)
T = 1
DO UNTIL V * (T / 100) * SIN(A) - 4.9 * (T / 100) ^ 2 < 0
X = V * (T / 100) * COS(A)
Y = V * (T / 100) * SIN(A) - 4.9 * (T / 100) ^ 2
IF Y > GY THEN GY = Y: GT = (T / 100)
T = T + 1
'PRINT X, Y, T
LOOP
TotT = T / 100 - .01
PRINT "Distance(M):", X
PRINT "Hangtime(Sec):", TotT
PRINT "Highest Point(M):", GY
PRINT "Time at Highest Point(Sec):", GT