[Date Prev][Date Next] [Thread Prev][Thread Next] [Thread Index] [Date Index] [Author Index]

*From*: Chris Burkert <chris chrisburkert de>*To*: dia-list gnome org*Subject*: Length of a PolyLine*Date*: Tue, 25 Jan 2005 21:39:50 +0100

Hi List,

at first I would like to thank all of you developers of dia.

from math import sqrt

points = dia.active_display().diagram.layers[0].objects[1].properties['poly_points']

distance = 0

size = len(points.value)

for i in range(size):

a = points.value[i]

if i < size-1:

b = points.value[i+1]

distance += sqrt(pow(2,a.x-b.x) + pow(2,a.y-b.y))

print distance

best regards Chris Burkert

1: http://www.chrisburkert.de/index.php?node_id=96 -- http://www.chrisburkert.de/

**Follow-Ups**:**Re: Length of a PolyLine***From:*Hans Breuer

[Date Prev][Date Next] [Thread Prev][Thread Next] [Thread Index] [Date Index] [Author Index] Mail converted by Mofo Magic and the Flying D

Other Directory Sites: SeekWonder | Directory Owners Forum

GuideSMACK