Math Help?

Richmond Mathewson richmondmathewson at gmail.com
Fri Apr 30 15:44:08 EDT 2010


  On 30/04/2010 22:05, Scott Rossi wrote:
> Hello List:
>
> Was wondering if those with more comprehensive math skills than I know how
> to determine if one point X,Y falls within a triangular region defined by 3
> points X1,Y1, X2,Y2, X3,Y3.  Thanks for any suggestions.
>
> Regards,
>

Well . . . my attempt is a bit babyish, but it may be something to work 
from:

I set up a polygon graphic "TWIG" and set its points to X1, Y1,  X2,Y2,  
X3, XY

I then made a button "Q" which is 1 pixel by 1 pixel and moved it to
points X4, Y4 and did this:

if the loc of btn "Q" is within the rect of graphic "TRIG" then
       put "INSIDE" into fld "OUTPUT"
    else
       put "OUTSIDE" into fld "OUTPUT"
       end if

Not rocket science, but it is here:

http://andregarzia.on-rev.com/richmond/STUFF/TRIGGER.rev.zip

sincerely, Richmond Mathewson.



More information about the use-livecode mailing list