News for hackers. Stuff that matters.
Re:Breaking down Amazon's mega dropdown by jules on Wednesday March 06, 2013 @06:52PM (#5334897)
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)
Re:Breaking down Amazon's mega dropdown by icambron on Thursday March 07, 2013 @03:09PM (#5339854)
My thought too. What are the supposed advantages of using linear algebra for this problem?

Edit: my guess is divide-by-zero conditions.