#!/usr/bin/env python # given distance and acceleration, compute the time of acceleration and deceleration # since d=1/2at^2 thus # 2d/a=t^2 #t should be sqrt(d/a) for a distance of 1/2 way to goal #This matches acceleration to deceleration times import math def moveto(distance,acceleration): accTime=math.sqrt(distance/acceleration) print "For distance ",distance,\ " and acceleration of ",acceleration,\ " Burn time is ",accTime,\ "Distance per burn",0.5*acceleration*accTime*accTime moveto(100,20)
0 comments:
Post a Comment