VTK/Examples/Python/DistanceBetweenPoints

From KitwarePublic
< VTK‎ | Examples‎ | Python
Revision as of 00:49, 22 August 2015 by Amaclean (talk | contribs) (→‎DistanceBetweenPoints.py)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

DistanceBetweenPoints.py

from __future__ import print_function
import vtk
import math

p0 = (0,0,0)
p1 = (1,1,1)

distSquared = vtk.vtkMath.Distance2BetweenPoints(p0,p1)

dist = math.sqrt(distSquared)

print("p0 = ", p0)
print("p1 = ", p1)
print("distance squared = ", distSquared)
print("distance = ", dist)