4 ms·
In this case the slope method is better and simpler than the cross product method. def slope(p): return (p.y-oldMouse.y)/(p.x-oldMouse.x) isInRa
by jules 14y ago
In this case the slope method is better and simpler than the cross product method.
def slope(p):
return (p.y-oldMouse.y)/(p.x-oldMouse.x)
isInRange = slope(menuBottom) <= slope(newMouse) <= slope(menuTop)
- deleted 14y ago[deleted]
- icambron 14y agoMy thought too. What are the supposed advantages of using linear algebra for this problem? Edit: my guess is divide-by-zero conditions.