Dynamic or not?

John Machin sjmachin at lexicon.net
Thu Dec 13 03:39:55 EST 2007


On Dec 13, 3:33 pm, Steven D'Aprano <st... at REMOVE-THIS-
cybersource.com.au> wrote:
> On Wed, 12 Dec 2007 19:18:20 -0800, rishiyoor wrote:
> > I'm trying to write a program that will find the distance between two
> > groups of points in space, which have cartesian co-ordinates X,Y and Z.
>
> points1 = [ (1.2, 3.4), (5.7, 9.2) ]
> points2 = [ (-6.3, 0.0), (14.1, -7.8), (2.6, 12.8) ]
>
> import math
> def distance(p1, p2):
>     return math.hypot(p1[0]-p2[0], p1[1]-p2[1])

X, Y, .... umm, aren't we short a dimension?



More information about the Python-list mailing list