Hi Vadim.
28-Mar-01 16:28:00, Vadim Gatcula wrote to All
What's UP All!
Need program or algorhythm: on the display there are random
pixels. Find the maximum square triangle that may be build on this
pixels.
A square triangle is one with a 90 degree corner? (right angle triangle)
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) )
---
Bye <=-
---
* Origin: This line selected pseudo - randomly. (3:640/531.42)