From 82c9610e55aa9925b1dbde1b8ca29941d5b0b424 Mon Sep 17 00:00:00 2001 From: Alan Aguiar Date: Mon, 20 Jan 2014 13:07:03 +0000 Subject: magnitude of vector is calculated --- diff --git a/src/api/Vector.py b/src/api/Vector.py index 64a9703..523d04d 100644 --- a/src/api/Vector.py +++ b/src/api/Vector.py @@ -78,12 +78,12 @@ class CVector(object): # Normalizes the vector. The vector will have a magnitude of 1. def normalize(self): - self.m = self.magnitude(); + m = self.magnitude(); # Check division by zero. - if (self.m > self.EPSILON): - self.x /= self.m; - self.y /= self.m; + if (m > self.EPSILON): + self.x /= m; + self.y /= m; # Truncates the vector assuring that the magnitude not exceed the limit. def truncate(self, aLength): -- cgit v0.9.1