Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #6896
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <ian.g.kelly@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.065 |
| X-Spam-Evidence | '*H*': 0.87; '*S*': 0.00; 'pm,': 0.10; 'wrote:': 0.14; 'math': 0.16; 'cheers,': 0.19; 'header:In-Reply-To:1': 0.21; 'thu,': 0.22; 'received:209.85.161.46': 0.23; 'received:mail- fx0-f46.google.com': 0.23; 'received:209.85.161': 0.26; 'message- id:@mail.gmail.com': 0.28; 'subject:?': 0.29; 'import': 0.29; 'to:addr:python-list': 0.33; 'received:google.com': 0.37; 'received:209.85': 0.37; 'subject:: ': 0.38; 'received:209': 0.39; 'to:addr:python.org': 0.39; 'so:': 0.84; 'subject:Best': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=ac6Cc94X8VcvIfAUhoM0GBKQDSYImlk2HVLCEtW9mB8=; b=OiorXcCJf2AXUZsRout5LF2GDMDSnR7Pauy5mxlpQU96VdkBYMDE2GU/EE1SyPovHi bA0MK3l/qo5GT+4NeHVX2infexv9u0y8udU/hH0cWcyNm/rIqSpz4HgzVT9Dw/2YwPwE mCq6egaUoT5zX686M+oe8k8p2LeSEle1Dm8yk= |
| DomainKey-Signature | a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=B2tAKGvZuosJOxdZ9/2grPV+25zRtk4CqLIQHaUAuqyO4zorH6J68y+aqHk7FdCnN8 /tvU7KuMUJDHRaDMUjUKw4uey4D7QrgIV0EwK9rG2FQCzWztVWnD4uoDSp4wPpCGnkAg 50SUogbAeF2gLLntrKatNIKvzPGdm4nYXIIb0= |
| MIME-Version | 1.0 |
| In-Reply-To | <201106030726.21147.akabaila@pcug.org.au> |
| References | <43d7a46e-3f48-4c11-a66b-a47a3d6b9b9d@k16g2000yqm.googlegroups.com> <mailman.2258.1306749013.9059.python-list@python.org> <a951396d-446b-4ad6-8ad3-d12420e251af@hg8g2000vbb.googlegroups.com> <201106030726.21147.akabaila@pcug.org.au> |
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | Thu, 2 Jun 2011 17:19:02 -0600 |
| Subject | Re: Best way to compute length of arbitrary dimension vector? |
| To | python-list@python.org |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2409.1307056774.9059.python-list@python.org> (permalink) |
| Lines | 13 |
| NNTP-Posting-Host | 82.94.164.166 |
| X-Trace | 1307056774 news.xs4all.nl 49044 [::ffff:82.94.164.166]:59323 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:6896 |
Show key headers only | View raw
On Thu, Jun 2, 2011 at 3:26 PM, Algis Kabaila <akabaila@pcug.org.au> wrote: > import math > > length = math.hypot(z, math.hypot(x, y)) > > One line and fast. The dimension is arbitrary, though, so: length = reduce(math.hypot, self._coords, 0) Cheers, Ian
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Best way to compute length of arbitrary dimension vector? Gabriel <snoopy.67.z@googlemail.com> - 2011-05-30 02:11 -0700
Re: Best way to compute length of arbitrary dimension vector? Chris Rebert <clp2@rebertia.com> - 2011-05-30 02:24 -0700
Re: Best way to compute length of arbitrary dimension vector? Peter Otten <__peter__@web.de> - 2011-05-30 11:46 +0200
Re: Best way to compute length of arbitrary dimension vector? Gabriel <snoopy.67.z@googlemail.com> - 2011-05-30 06:38 -0700
Re: Best way to compute length of arbitrary dimension vector? Ian Kelly <ian.g.kelly@gmail.com> - 2011-06-02 17:19 -0600
Re: Best way to compute length of arbitrary dimension vector? Gabriel <snoopy.67.z@googlemail.com> - 2011-06-03 14:53 -0700
Re: Best way to compute length of arbitrary dimension vector? Ian Kelly <ian.g.kelly@gmail.com> - 2011-06-03 16:17 -0600
Re: Best way to compute length of arbitrary dimension vector? Robert Kern <robert.kern@gmail.com> - 2011-06-03 18:12 -0500
Re: Best way to compute length of arbitrary dimension vector? "Gabriel Genellina" <gagsl-py2@yahoo.com.ar> - 2011-05-30 16:01 -0300
Re: Best way to compute length of arbitrary dimension vector? Gabriel <snoopy.67.z@googlemail.com> - 2011-06-01 12:35 -0700
csiph-web