Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/api/Math.py
diff options
context:
space:
mode:
authorAlan Aguiar <alanjas@hotmail.com>2014-02-24 05:01:02 (GMT)
committer Alan Aguiar <alanjas@hotmail.com>2014-02-24 05:01:02 (GMT)
commit50262b31c871e45c14339a063901c108d764a54b (patch)
tree4e3c3e39147e555b9c570334dbfa27730dd1e758 /src/api/Math.py
parent51571ece0306e588ef00cf99ba2fcdcda358e121 (diff)
add distance vec in math
Diffstat (limited to 'src/api/Math.py')
-rw-r--r--src/api/Math.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/api/Math.py b/src/api/Math.py
index 41d67ae..a86b5b5 100644
--- a/src/api/Math.py
+++ b/src/api/Math.py
@@ -49,6 +49,9 @@ def degToRad(aAngle):
def dist(ax1, ay1, ax2, ay2):
return math.sqrt((ax2-ax1)**2 + (ay2-ay1)**2)
+def distVec(a, b):
+ return math.sqrt((a.x-b.x)**2 + (a.y-b.y)**2)
+
# determine if a point is inside a given polygon or not
# Polygon is a list of (x,y) pairs.
# http://www.ariel.com.au/a/python-point-int-poly.html