- #1
forty
- 135
- 0
Given 3 points of the triangle:
(1,2)
(4,6)
(9,10)
Determine if point (5,4) belongs to triangle (is located inside the triangle).
the only way i can think of doing this is as follows but there must be a more sound way.
so you have lines:
(1,2)->(4,6)
(4,6)->(9,10)
(1,2)->(9,10)
you need all 3 of the following to hold true for point (5,4)
y <= 4/3x + 2/3 (true)
y >= x + 1 (false)
y <= 4/5x + 14/5 (false)
any help greatly appreciated.
(1,2)
(4,6)
(9,10)
Determine if point (5,4) belongs to triangle (is located inside the triangle).
the only way i can think of doing this is as follows but there must be a more sound way.
so you have lines:
(1,2)->(4,6)
(4,6)->(9,10)
(1,2)->(9,10)
you need all 3 of the following to hold true for point (5,4)
y <= 4/3x + 2/3 (true)
y >= x + 1 (false)
y <= 4/5x + 14/5 (false)
any help greatly appreciated.