ScratchData LogoScratchData
Back to TheLogFather's profile

Direction to point

THTheLogFather•Created February 20, 2014
Direction to point
28
32
1087 views
View on Scratch

Instructions

See http://scratch.mit.edu/discuss/topic/30265/ Shows how to calculate the direction of a point from another. The angle it gives goes from -180 to +180 degrees, and follows Scratch's 'point in direction' convention. Also shows the distance between the points, for completeness. Drag the dots to change the direction of the red line.

Description

* updated displays to show only 3dp again (now that Scratch has switched to showing 6dp by default...) The method it uses is based upon the inverse tangent (atan) of the gradient of the line joining the two points. The inverse tangent only returns an angle from -90 to +90, so it needs a bit of extra work to check for the remaining sections (+90 to +180 and -90 to -180).

Project Details

Project ID18216247
CreatedFebruary 20, 2014
Last ModifiedJune 7, 2014
SharedFebruary 21, 2014
Visibilityvisible
CommentsAllowed

Remix Information

Parent ProjectView Parent
Root ProjectView Root