[algogeeks] Re: Testing if 3 points form a triangle

2007-05-27 Thread [EMAIL PROTECTED]
In 3D, we can test |(p2-p1)*(p3-p1)|==0, where p1,p2 and p3 are vectors. On 5月27日, 上午7时22分, Feng [EMAIL PROTECTED] wrote: Hi all! Given 3 points in 3D, what is the fast and numerically stable way to test if they form a triangle? I am thinking computing the determinant of the square matrix

[algogeeks] Re: Testing if 3 points form a triangle

2007-05-27 Thread [EMAIL PROTECTED]
in 3D,we can test |(p2-p1)*(p3-p1)|==0,where p1,p2,p3 are 3D-vectors that represent the three points. in n-dimension,i think we can let A=(a1,a2,...,an)=p2-p1, and B=(b1,b2,...,bn)=p3-p1, and test every elements of the matrix (ATB- BTA). That is ai*bj-aj*bi. On 5月27日, 上午7时22分, Feng [EMAIL

[algogeeks] need help very desperately !

2007-05-27 Thread mirchi
i attempting to solve a problem where a triangle contains many white triangles and black triangles inside it. it is required to find the largest white triangle. the whole question can be found at : http://acm.uva.es/p/v5/585.html my code is pasted below : can anyone please test my code and