def __constrain(self, vector, axis): """ private constrain (used to constrain axis) """ vector.sub(axis.mult(axis, PVector.dot(axis, vector))) vector.normalize() return vector
def mouseDragged(self, x, y): """ pass in mouse.x and mouse.y parameters from sketch """ self.v_drag = self.__mouse2sphere(x, y) self.q_drag.set(PVector.dot(self.v_down, self.v_drag), self.v_down.cross(self.v_drag))
def dot(cls, a, b): return __pvector__.dot(a, b)
def dot(cls, a, b): return RealPVector.dot(a, b)