jmoenig / Snap

a visual programming language inspired by Scratch
http://snap.berkeley.edu
GNU Affero General Public License v3.0
1.49k stars 743 forks source link

Values in "point in direction" (just curious) #711

Closed geaplanet closed 9 years ago

geaplanet commented 9 years ago

Why "point in direction" values are 90 right -90 left 0 up 180 down?

I find dificult explain to my pupils why these values. Would not it be more logical with the same values in degrees related with the "turn" block? 0 right 90 up 180 left 270 down

I was looking on wikipedia if there was some sort of mathematical convention in the Anglo world, but the whole issue of degrees, radians, quadrants, etc ... looks the same everywhere...0º right and then open the angle in the anti-clockwise direction until 90ª up...

brianharvey commented 9 years ago

Well, first of all, the TURN blocks don't have absolute headings associated with them -- that's the whole point! They turn clockwise or ccw from however the sprite is pointing now.

The clockwise-from-north scale for absolute heading is something Scratch inherited from Logo, and we inherited from Scratch. It's the scale used in navigation or orienteering, as opposed to mathematics. The original choice in Logo was meant to be "body-syntonic," meaning that what happens on the screen should follow the intuitions you develop moving in the world. And indeed kids seem to find it natural to use compass directions to name the edges of the screen. Also, in Logo we didn't have Scratch's nice unambiguous curved arrows for the TURN blocks; the corresponding commands were called RIGHT and LEFT, which in any case go along with how you give directions in real life; you don't say "turn clockwise at the third traffic light." So it's helpful to make a verbal distinction between RIGHT and LEFT, which are relative turns, and East and West, which are absolute headings.

The reason you now find this confusing is that Scratch kept part of this model while changing other parts. Logo has a consistent metaphor of the screen as a map of the world, seen (like most maps) looking down from above. Even in versions of Logo that had an actual turtle picture rather than an arrowhead, it was a picture of the turtle's shell seen from above. You have to imagine that Scratch chose cat2 as their logo instead of the side-view cat.

But they did choose the side-view cat, and they wanted MOVE without any turns to move it forward, i.e., toward the East edge. And they changed the name of the orientation reporter from HEADING, which is consistent with the orienteering metaphor, to DIRECTION, which is a more familiar word but not part of any specific metaphor. In retrospect, once they decided on a side view, maybe they should have also decided that direction 0 is eastward on the screen.

I was aware of this history and this ambiguity when I got involved in the BYOB3 design, but at that point we were trying hard not to change Scratch any more than we had to, so this didn't seem an important battle to fight. And now it's way too late; changing scales would break projects.

jmoenig commented 9 years ago

Thanks, Brian!

That said, there is nothing stopping you in Snap! to build your own heading blocks using whichever directions and coordinates you prefer, and to simply hide the default blocks in the palette :-)

geaplanet commented 9 years ago

Very interesting, Brian. I'm trying what Jens says. How could I do the drop list for cloning that block? That is, I did a new block with the behavior I need at school (mathematic model for directions, angles, trigonometry...), but I did only with a number input control and I was wondering if is there any way to clone the drop down list in "point in direction _" block, where you can use both, a number or a single element in the list.

Thanks.

brianharvey commented 9 years ago

Make a block, click on a plus sign to give it an input, open the long-form input dialog by clicking on the right arrowhead, then right-click or control-click on the dark grey background of the array of input types. Choose "options..." from the menu. Enter the text of the items you want, e.g., "right (0)=0", one per line. (The parentheses are part of the text of the option; the equal sign separates the text from the value it represents.) Don't put a newline after the last option! (This is a workaround for a bug.) Since you want the values to be numbers, click on the number type in the type array. Done!

geaplanet commented 9 years ago

Cool! It worked perfectly. Thanks a lot, Brian!

cycomachead commented 9 years ago

And indeed kids seem to find it natural to use compass directions to name the edges of the screen.

@brianharvey This isn't really a Snap! thing, but a BJC curriculum one. We should really have a note about the compass thing, because I think many people, myself included, easily forget that it's the same as that. The problem is by the time many of the older students get to Snap!, all we can think of is the beatings we got by middle school geometry.