Subj : Need program To : Vadim Gatcula From : Jasen Betts Date : Wed Apr 04 2001 10:02 am Hi Vadim. 28-Mar-01 16:28:00, Vadim Gatcula wrote to All VG> What's UP All! VG> Need program or algorhythm: on the display there are random VG> pixels. Find the maximum square triangle that may be build on this VG> pixels. A square triangle is one with a 90 degree corner? (right angle triangle) VG> If you have'nt the prog - maybe you tell me algor.? ;) using vector dot product. (x1-x2)* (x1-x3) + (y1-y2) * y1-y3) This expression is 0 when (x1,y1) is the 90 degree corner of a triangle made from (x1,y1) (x2,y2) and (x3,y2) You'll have to try every point as (x1,y1) against every other pair of points. The size (area) of a triangle is can be got by using vector cross product. 0.5 * abs ( (x1-x2) (y1-y3) - (x1-x3) * (y1-y2) ) VG> --- -=> Bye <=- --- * Origin: This line selected pseudo - randomly. (3:640/531.42) .