All pastes #806256 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-12-05 01:57 UTC
rendered paste body
# o is the ship, target is a point in space

                        course = norm(target.pos - o.pos)

                        distance = abs(o.pos - target.pos)

                        hw = distance/2

                        t = o.max_thrust/2*hw
                        t = vector([math.sqrt(t[0]), math.sqrt(t[1]), math.sqrt(t[2])])
                        # sqrt done seperately due to limitation of vector library