Skip to content

Commit

Permalink
MINOR: FIX: Store vector components as floats (fixes #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhikpal committed Aug 13, 2017
1 parent 225b7e8 commit 2b96dfc
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions p5/pmath/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ class Vector(Point):
"""
def __init__(self, x, y, z=0):
self._x = x
self._y = y
self._z = z
self._array = np.array([x, y, z])
self._array = np.array([x, y, z], dtype=np.float32)

@property
def x(self):
Expand All @@ -68,7 +65,6 @@ def x(self):

@x.setter
def x(self, value):
self._x = value
self._array[0] = value

@property
Expand All @@ -78,7 +74,6 @@ def y(self):

@y.setter
def y(self, value):
self._y = value
self._array[1] = value

@property
Expand All @@ -88,7 +83,6 @@ def z(self):

@z.setter
def z(self, value):
self._z = value
self._array[2] = value

def distance(self, other):
Expand Down

0 comments on commit 2b96dfc

Please sign in to comment.