Find area of Triangle(A) and area of Polygon with these four points(B) if A<B point lies outside triangle if A>B point lies inside triangle else on if they are equal, it lies on triangle.
On Tue, Sep 21, 2010 at 5:03 PM, jagadish <jagadish1...@gmail.com> wrote: > Here is the Simplest working solution :) > > bool check(int x[],int y[],int n) > { > c=0; > for(int i=0;i<n;i++) { > j=(i+1)%n; > if( ((y[i]>y) != (y[j]>y)) && (x-x[i]/x[j]-x[i] < y-y[i]/y[j]-y[i]) > c=!c; > } > return c; > } > > > On Sep 20, 7:46 pm, umesh kewat <umesh1...@gmail.com> 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 min 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 algoge...@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- <<Bharath>> -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.