Export to GitHub

pyeuclid - issue #7

Feture request: Angles between vectors


Posted on Feb 4, 2010 by Helpful Rabbit

Hello, I was interested in getting the angle between two vectors and wrote some code to do it. Might be useful for other people.

def angle(v1, v2): '''Returns angle between two Vector3's.''' q = v1.normalized().dot(v2.normalized()) if q < -1.0: return pi elif q > 1.0: return 0.0 else: return acos(q)

Comment #1

Posted on Apr 5, 2011 by Grumpy Bear

Yesterday I added Vector2.angle(other) and Vector3.angle(other) that implement this request.

Status: Fixed

Labels:
Type-Defect Priority-Medium