Ejemplo n.º 1
0
	def _fingerDirection(gesture):
		gestureType, centerOfMass, fingerPoint = gesture
		x, y = Helpers.subtractVectors(fingerPoint, centerOfMass)
		fingerAngle = math.degrees(math.atan2(y, x))
		fingerAngleDirections = [("left",0), ("up",90), ("right",180)]
		direction = (np.abs(np.array(map(lambda x:x[1], fingerAngleDirections)) - abs(fingerAngle))).argmin()
		return map(lambda x:x[0], fingerAngleDirections)[direction]