Thursday, September 1, 2011

Project Euler Problem #102 Solution

A triangle in \( \mathbb{R}^2 \) contains the origin iff it has two edges such that

  1. one edge intercepts the \( y \)-axis at \( b_1 > 0 \), and
  2. the other edge intercepts the \( y \)-axis at \( b_2 < 0 \).
Therefore, for each triangle specified in the provided file, we can perform that test:

0 comments:

Post a Comment