Use Barycentric Coordinates: Let the point A have coordinates (xa,
ya), and similar for points B, C, and Z. Solve the system of linear
equations

xa * a + xb * b + c = xz
ya * a + yb * b + c = yz
     a +      b + c = 1

for a, b, and c. If all of a, b, and c are >= 0, the point is in the
triangle (> 0) or on the boundary (= 0). Otherwise, the point is
outside the triangle.

Dave

On Sep 20, 10:02 am, umesh <[email protected]> wrote:
> Initially we have given  three point A , B, C in plane represent three
> nodes of triangle, now given another point Z  which lies in same
> plane,  find out whether that point lies on/inside the triangle or
> outside of triangle....try to get in minimum time and space
> complexity
>
> --
> Thanks & Regards
>
> Umesh kewat

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to