Demo Highlight: Angles

joestrout

JoeStrout

Posted on December 13, 2023

Demo Highlight: Angles

Today I'd like to highlight another one of the demos that comes built-in with Mini Micro: /sys/lib/angles.ms.

This one is a little different from most of the other demos, in that it has educational value while running, rather than only while studying the code! It creates a nice interactive display that explains and illustrates angles, as measured in both radians and degrees.

Screen shot of angles demo

Degrees are consistently shown in purple, while radians are always shown in green, to help you match up the values you see on the right with the explanations on the left.

You can click anywhere around the wumpus at upper right, or the triangle diagram at lower right, and drag the mouse to dynamically change the angle shown. The wumpus shows what that rotation looks like when applied (in degrees) to a sprite; and the triangle, plus the three values below, shows how sin, cos, and atan relate the angle (in radians) to horizontal and vertical distance.

This demo will be great for younger coders who have not been taught trigonometry yet, or for anyone whose memory of those lessons may be a little rusty. Even if your trig is strong, it may still be useful. Not sure whether to use angles or degrees with a sprite rotation? Want to find exactly what angle corresponds to the "jaunty tilt" you have in mind? Fire up /sys/lib/angles and quickly find out!

If you are on a desktop machine, you can try this demo right now on the web by clicking here.

Or, if you have Mini Micro already, just fire it up and enter:

run "/sys/demo/angles"
Enter fullscreen mode Exit fullscreen mode

When you're done playing around with angles, just press the Esc or Q key to quit. And then feel free to use the edit command to poke at the code!

💖 💪 🙅 🚩
joestrout
JoeStrout

Posted on December 13, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Version Checking in MiniScript
miniscript Version Checking in MiniScript

June 20, 2024

Text entry tricks in Mini Micro
miniscript Text entry tricks in Mini Micro

April 17, 2024

Using textures from /sys/pics/textures
miniscript Using textures from /sys/pics/textures

January 24, 2024

Demo Highlight: Angles
miniscript Demo Highlight: Angles

December 13, 2023

Pixel-Perfect Sprite Clicks
miniscript Pixel-Perfect Sprite Clicks

October 13, 2023