Code style query: multiple assignments in if/elif tree

Chris Angelico rosuav at gmail.com
Tue Apr 1 02:55:32 EDT 2014


On Tue, Apr 1, 2014 at 5:13 PM, Ian Kelly <ian.g.kelly at gmail.com> wrote:
> Then your computation is incorrect and will systematically
> underestimate the stopping distance.  Assuming for simplicity that the
> acceleration actually increases linearly until it reaches maximum,
> picture the velocity graph between, say, t=0 and t=1s.  You are
> modeling it as a straight line segment.  However, it would actually be
> part of a quadratic curve connecting the same points, convex upwards.
> The line segment is short-cutting the curve between the two points.
> The distance traveled is the integral of the curve, and it is easy to
> see that the integral of the line segment is less than the integral of
> the actual curve.

.... great.

Okay. I never studied calculus, so this is beyond my expertise. Is
this going to make a majorly significant difference to the end result?
If so, I guess the code's going to have to be a whole lot more
sophisticated, which means I need to learn a whole lot more maths in
order to write it. And I'm still trying to find time to get familiar
with systemd (having jumped on the Upstart bandwagon and now find
myself backing a losing horse, if you'll forgive a mixed metaphor) and
Cython (just need an excuse for that one).

ChrisA



More information about the Python-list mailing list