'velo.bas
'program calculates flight duration and distance for flying landyacht
CLS
VehicleWeight = 500
VehicleVelocity = 60 * 1.4666
WindVelocity = 20 * 1.4666
ApparentWindVelocity = VehicleVelocity + WindVelocity
WingArea = 60
AspectRatio = 6
PIxAR = 3.1415 * AspectRatio
CLwing = VehicleWeight / (.5 * .002378 * ApparentWindVelocity ^ 2 * WingArea)
CDwing = (CLwing ^ 2 / PIxAR) + .01
FrontalArea = 10
CDbody = .12
LoopCount = 0
FlightDistance = 0
Deceleration = 0

DO
ApparentWindVelocity = VehicleVelocity + WindVelocity
CLwing = VehicleWeight / (.5 * .002378 * ApparentWindVelocity ^ 2 * WingArea)
CDwing = (CLwing ^ 2 / PIxAR) + .01
WingLift = CLwing * .5 * .002378 * ApparentWindVelocity ^ 2 * WingArea
WingDrag = CDwing * .5 * .002378 * ApparentWindVelocity ^ 2 * WingArea
BodyDrag = CDbody * .5 * .002378 * ApparentWindVelocity ^ 2 * FrontalArea
Deceleration = 32.2 * (WingDrag + BodyDrag) / VehicleWeight
VehicleVelocity = VehicleVelocity - Deceleration
FlightDistance = FlightDistance + VehicleVelocity + (Deceleration / 2)
LoopCount = LoopCount + 1
PRINT LoopCount; CLwing; WingDrag + BodyDrag; VehicleVelocity / 1.4666; (VehicleVelocity + WindVelocity) / 1.4666; FlightDistance
LOOP WHILE CLwing < 1.4

PRINT " Flight distance"; FlightDistance; "feet"
PRINT " Flight duration"; LoopCount; "seconds"