diff options
author | Alan Aguiar <alanjas@hotmail.com> | 2014-02-24 05:01:02 (GMT) |
---|---|---|
committer | Alan Aguiar <alanjas@hotmail.com> | 2014-02-24 05:01:02 (GMT) |
commit | 50262b31c871e45c14339a063901c108d764a54b (patch) | |
tree | 4e3c3e39147e555b9c570334dbfa27730dd1e758 | |
parent | 51571ece0306e588ef00cf99ba2fcdcda358e121 (diff) |
add distance vec in math
-rw-r--r-- | src/api/Math.py | 3 |
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
|