Computing heading

Lex Spoon lex at cc.gatech.edu
Sun Jan 4 19:59:26 UTC 2004


Jack Johnson <fragment at nas.com> wrote:
> I was messing around with EToys and grabbed an arrow morph and a couple  
> of ellipses and wanted to have the arrow morph automatically place  
> itself between the two ellipses and point from one to the other.
> 
> The placement was easy, but I had trouble computing the heading.  I did  
> come across a formula used for computing a bearing based on two map  
> coordinates:


EToys doesn't have to use coordinates....  You can tell a morph to point
to another morph.

Hmm, actually, you can't do that exactly.  But you can tell a morph to
*move toward* another morph.  So try moving it to right place, telling
it to move toward the other morph, and then moving it back to the right
place again.


Lex



More information about the Squeak-dev mailing list