Simon Wheatley <[EMAIL PROTECTED]>
> Can anyone tell me if this kind of thing is possible:
> 
> -- ie work out distance to cover in x and y
> on globalToLocal pt, cr 
>   return [#xx:(pt[#xx]-cr[#xx]), #yy:(pt[#yy]-cr[#yy])]
> end

Hi Simon,

You can do all sorts of fun things with points and lists:

-- Operations on points
pt = point(123, 456)
cr = point(345, 876)
put cr - pt
-- point(222, 420)

-- Operations on lists
put [#x: pt, #y: cr] - [#x: cr, #y: pt]
-- [#x: point(-222, -420), #y: point(222, 420)]

-- Using Pythagoras' theorem
tOffset = cr - pt
put sqrt((tOffset.locH * tOffset.locH) + (tOffset.locV * tOffset.locV))
-- 475

Cheers,

James


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to