geometry-challenged

Dar Scott dsc at swcp.com
Sat Jan 24 18:46:22 EST 2004


On Saturday, January 24, 2004, at 04:09 PM, Trevor DeVore wrote:

>   put item 1 of loc of button 2 - item 1 of loc of button 1 into 
> tDeltaX
>   put item 2 of loc of button 2 - item 2 of loc of button 1 into 
> tDeltaY
>   put atan2(tDeltaY, tDeltaX) into tRadianAngle
>   put tRadianAngle * (180/pi) into tDegreeAngle
>   put tDegreeAngle into field 1

Though this can be done without trig, getting the angle like this has 
the advantage of avoiding divide-by-zero problems.

>   put ((width of button 1/2) * cos(tRadianAngle)) + item 1 of loc of 
> button 1 into tNewX
>   put ((height of button 1/2) * sin(tRadianAngle)) + item 2 of loc of 
> button 1 into tNewY
>   set loc of graphic 1 to tNewX,tNewY

This looks fishy to me.

I seems to me you have to figure out which side of the box the line 
will be crossing.

Of course, one has to figure out only one end of the problem because 
the other end is done the same way.

Dar Scott



More information about the use-livecode mailing list