The points must satisfy the equation (x-x1)(x-x2)+(y-y1)(y-y2)=0
Circle centered at origin x2+y2=Some radius .With N points on the circle , we find out the radius In order to find if the two points are antipodal , we check the first equation putting the two points and checking for any other point on the circle if it satisfies the equation . Test for antinodality . This will do in O(1) . Given N points and we have to find if two points are antinodal On Feb 26, 11:15 am, Mohan Mangal <[email protected]> wrote: > Hi Vinay, > > Here the condition is Point lies on same circle.. > hope you got it. > > > > On Sat, Feb 26, 2011 at 10:58 AM, vinay reddy <[email protected]> wrote: > > Hi Dave, > > I don't think ur logic will cover all cases like (1,1)(-3,-3), (1,1) > > (2,2) a line connecting these points passes through origin, > > i think the solution is, we need to compute the slope of the point at index > > i with origin and build a binary tree with theses slopes. > > but worst cases of this algo is N*N , if we try balancing the tree while > > inserting I guess it can be done in NlogN > > Thanks > > Vinay > > > On Fri, Feb 25, 2011 at 9:20 AM, Gene <[email protected]> wrote: > > >> Dave's solution is best if numerical error is possible. > >> If the points are precise, you can also do it in linear time. Just hash > >> the points on abs(y/x). > > >> -- > >> 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. > > > -- > > 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. > > -- > Regards, > Mohan Mangal > Software Engineer, Bangalore > Mob- 80952-03670 -- 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.
