Method 1:
Yes you can do by writing equation of 3 lines taking 2 points at a time and
finding the sign with the third point.

Suppose: ax+by+c=0 is your first line and (x,y) is the third point then find
out the sign of the 3rd point satisfying it on the line. suppose this sign
is S (for +ve)

Similarly calculate for signs for other 2 lines.

Now give a point(p,q) should give the same signs for all the 3 lines .If it
gives the same sign for all the 3 lines that means it lies btwn all the 3
lines and all the 3 points.hence proved.

Method 2: Area mentioned by praveen

Method 3:
http://en.wikipedia.org/wiki/Barycentric_coordinates_(mathematics)#Determining_if_a_point_is_inside_a_triangle

You can choose the best method.

On Mon, Sep 20, 2010 at 9:18 PM, Nicolae Titus <[email protected]>wrote:

> there are some approximations involved there, it should be (area(big) -
> sum(area small)) < error
> a better approach would be to find if the point is on the proper side of
> each edge
> take all the edges clockwise and calculate the sinus between each edge and
> the point, if they are all positive, the point is inside.
>
> Titus
>
> --
> 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]<algogeeks%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
Thanks & Regards
Nikhil Agarwal
Senior Undergraduate
Computer Science & Engineering,
National Institute Of Technology, Durgapur,India
http://tech-nikk.blogspot.com
http://beta.freshersworld.com/communities/nitd

-- 
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