Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.024 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.01; 'forgive': 0.05; 'say,': 0.05; 'great.': 0.07; 'subject:query': 0.07; 'assuming': 0.09; 'curve': 0.09; 'integral': 0.09; 'mixed': 0.09; 'cc:addr:python- list': 0.11; '(just': 0.16; 'calculus,': 0.16; 'curve.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'incorrect': 0.16; 'jumped': 0.16; 'losing': 0.16; 'segment': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'cc:addr:python.org': 0.22; 'stopping': 0.24; 'subject:Code': 0.24; 'cc:2**0': 0.24; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; 'reaches': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'guess': 0.33; 'actual': 0.34; 'beyond': 0.35; 'received:google.com': 0.35; 'so,': 0.37; 'two': 0.37; 'pm,': 0.38; 'skip:u 10': 0.60; 'easy': 0.60; 'ian': 0.60; "you'll": 0.62; 'myself': 0.63; 'connecting': 0.64; 'more': 0.64; 'distance': 0.65; 'modeling': 0.65; 'between': 0.67; '.....': 0.78; 'maths': 0.84; 'one).': 0.84; 'points,': 0.84; 'traveled': 0.84; 'distance.': 0.91; 'increases': 0.91; 'to:none': 0.92; 'picture': 0.97 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=R4WnT9+u1pyWWlNdeM14SbI7FUK5hmD4nUjsiYNvx0o=; b=khpC1OpMAz5uYH4VEb2tAv7Z9Q0SN7U2x8QZNautGcQN46j1+2QxUab4pJojAKUgmE 0o5IU0gI9N7DsuIVzbgslC6E2V1n/UIjTfU0yHXCJ3h8u0jMDKxSWiKE7fnNN11JgVzD NffyYoeJVGqGVPJk/s3V/LRgIPrcdlHcqGi9ZjW/gmaVz99Q7XRPeKVg5A0co+HRUPOz EJwNj9AyRvRtxaMCHrNuhhV3pF80jCm2ST6+4kKS8jFmU0fmYSxqCaH/GluRpPtr5Ivn PSuWwcaoGQtxmKt3cpHbwFBRoNSEWOxmcuvCOft5MbTbhinpg1jVYyo1rY53DodPqlz7 7pXA== MIME-Version: 1.0 X-Received: by 10.68.236.41 with SMTP id ur9mr29463114pbc.101.1396335332281; Mon, 31 Mar 2014 23:55:32 -0700 (PDT) In-Reply-To: References: <533a3fd8$0$2909$c3e8da3$76491128@news.astraweb.com> Date: Tue, 1 Apr 2014 17:55:32 +1100 Subject: Re: Code style query: multiple assignments in if/elif tree From: Chris Angelico Cc: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1396335341 news.xs4all.nl 2924 [2001:888:2000:d::a6]:49504 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:69477 On Tue, Apr 1, 2014 at 5:13 PM, Ian Kelly 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