Finished with ECF Project

This commit is contained in:
Grant Sanderson
2015-06-22 10:14:53 -07:00
parent fc395d14e1
commit 1dc7a5421d
9 changed files with 632 additions and 258 deletions

View File

@ -95,10 +95,12 @@ class Mobject(object):
self.points += v
return self
def wag(self, wag_direction = (0, 1, 0), wag_axis = (-1, 0, 0)):
def wag(self, wag_direction = RIGHT, wag_axis = DOWN,
wag_factor = 1.0):
alphas = np.dot(self.points, np.transpose(wag_axis))
alphas -= min(alphas)
alphas /= max(alphas)
alphas = alphas**wag_factor
self.points += np.dot(
alphas.reshape((len(alphas), 1)),
np.array(wag_direction).reshape((1, 3))