Wednesday, December 23, 2020

Addendum to Scalene Triangle Mouse I

   At the conclusion of the Coding the Scalene Triangle Mouse I document, I described what I considered to be a flaw in the code; when completing the third leg of the triangle the mouse did not actually point to the starting point of the triangle but moved in a skewed fashion.
   Scratch does contain a [point towards (mouse-pointer or another sprite)] block. 

   I suppose one could make the starting point of the triangle a small circular sprite and then simply ‘point to it’ to draw the third leg of the triangle. I call this approach a work-around as it solves the problem for the present but when time allows a more elegant solution will be found. So I thought about how to create code that will point the mouse from one point to any other specified point. In other words, I wanted to code a generalized solution. It turns out that the basic trigonometry operator, tangent (angle) abbreviated tan(angle) helps to solve the problem.
   In Scratch, the tan operator (see below) returns the numerical ratio of the opposite side over adjacent side as shown in the diagram above. 
   The arctan operator takes the numerical ratio and returns the angle.
   For example, for a 38º angle, tan 38º = 0.7812 and the arctan of 0.7812 = 38º

     In the diagram below the xpos and ypos reporters in Scratch return the values for x2 and y2. The values for x1 and y1 are set in the code. These values are used to compute the tangent of the angle and then the arctangent operator computes the value in degrees of the angle. The mouse can then be turned to the left through the angle (90º - angle)  to be pointed directly towards the point (x1, y1).
  I have written a detailed tutorial describing the coding of the above addendum to the Scalene Mouse Triangle project. A free PDF file of this document that might be useful to both teachers and students can be obtained by emailing me at

Monday, December 21, 2020

Pen Commands in Scratch 3

   Go to and click on Create in the upper left corner. The Editor page, shown below, will open. This version is Scratch 3. Earlier versions of Scratch had a Pen tab listed with the other colored categories of blocks. Scratch 3 has moved the Pen commands. 
   To find them, note the small blue block in the lower left of the Scratch home screen. The blue icon indicates additional blocks. Click on the blue icon and a page of additonal commands are revealed. 

   Click on the Pen icon in the lower left corner of the above menu to reveal a page of options. Choose the option Pen.
   Click on Pen as pictured above to reveal the list of Pen Commands as we knew them in Scratch 1 and Scratch 2.

    If you use Pen commands in a project, every time you open the project the Pen icon will appear under the My Blocks menu icon.

   A copy of this post in PDF file format suitable for teacher or student use can be obtained, free of charge, by sending an email request to

Coding Math Concepts as Tests of Student Comprehension

    In Bloom's Taxonomy of Educational Objectives, a test of a learner's 'comprehension' of a concept is the ability of the learner to 'rephrase’ or ‘restate' the concept in as many different ways as possible. For several years I have been interested in using standard mathematics curriculum as a source of computer coding exercises in which students ‘rephrase’ math concepts. Geometry is an especially rich source for computer coding projects. In this post we use computer code to explore the scalene triangle concept.

Where to begin?

Scalene triangle: A triangle with three unequal side lengths and three unequal angle measures

The definition tells us how to recognize a scalene triangle if we know the lengths of the three sides.  But the definition is static, not dynamic. Typing the definition into computer code will code the individual letters (ASCI II) but the code simply displays the definition as text, not as a figure of a scalene triangle.

This is often a point of frustration with beginning programmers as they may know a ‘concept’ as a set of words or symbols but become frustrated when trying to code the concept.

To code a scalene triangle in Scratch is not a trivial exercise.

To begin, I’ve created a starter project that has a mouse as sprite 1. You can click on this link to download the project or create your own starter.

                                    Scalene Triangle Mouse Starter

   The completed project can be downloaded by clicking on the following link.

Scalene Triangle Mouse I

   I am in the process of writing a detailed tutorial describing the coding of the Scalene Triangle Mouse I project. A free PDF file of this document that might be useful to both teachers and students can be obtained by emailing me at

   The following projects are in the same spirit as each project codes a math concept.

Radian Mouse

Perpendicular Mouse

Parallel Mouse

Angle Mouse

Wednesday, September 9, 2020

Virtual Robotics


Robotics is a hot component of the STEM (Science, Technology, Engineering, Mathematics) movement. Several companies offer robotics hardware and software that supports educators and students.

One of the problems robotics educators face is that there is not an agreed upon sequence of knowledge requirements and a sequence of skill development as there is, for example, for mathematics and science education.

Years ago I watched a video on educational TV that was my introduction to robotics as a topic for educators. The program featured a mechanical engineering professor at MIT describing a project assigned to his freshman engineering students. Each pair of students were given a box of electric motors, gears, wheels and other small parts. The task was to build a robot controlled by a joystick. Students were shown in the machine shop drilling, grinding and wiring their robots. The project culminated in a King of the Mountain competetion. Students robots fought each other to stay at the crest of a hill for a given amount of time.

Along with the mechanical engineering standards he taught he also wanted his students to understand that every engineering task was always constrained by a least three limiting factors.

1. Time to complete the engineering project is not unlimited.
2. There is always a limit on the amount of money available to complete the project.
3. There is always something new that has to be learned.

Great information for men and women looking to become engineers

A teacher in east Russia has rekindled my interest in educational robotics and is the
inspiration for this blog post. As a teacher, Andrei is interested in Scratch and robotics.
Scratch is complete and free but robotics hardware is expensive. Most teachers do not have
the financial support to equip a classroom with several robots. Many teachers have just one
robot, often purchased with their own funds, to demonstrate to students.

In researching the latest robotics hardware and software I found a company, www.vex.comthat was new to me. Vex understands that not all teachers have the funds to invest in the robotics kits they sell. To help with this problem, Vex provides a' virtual' robot modeled after one of their hardware robots. The code used to control the virtual robot is the same code used to control the real robot.

Students that are working with one of the Vex hardware robots at school can now program at
home and test their code on the virtual robot. Students without a real robot can still program the virtual robot. Click on the following link to go to the Vex Virtual Robot.

Vr.vex runs in your browser so there is nothing to download. Those familiar with Scratch

will immediately recognize the Vr.vex home screen.

The 'blocks' snap together like Scratch blocks. Below is the code for a Spirolateral (see link
to my Spirolateral post below) that executes right turns only.

Te display screen is called a playground and specific playgrounds are selected from
a drop down menu. Below is the isometric view that displays a run of the above code.

In the following picture the top-down view is displayed.

   The Vr.vex website has several sample projects that offer robot problems to
solve. If you are interested in robotics, search the Vex website for both hardware and software products.

   Here are two Scratch-blog posts that have robotics as a theme.

Spirolaterals in Scratch

   Mark Johnson has the following videos on Youtube that are worth watching.

VEX VR Introduction-Square (VR Series Part 1)

VEX VR Variables (VR Series Part 2)

VEX VR Functions (VR Series Part 3)

VEX VR Basketball Drills (VR Series Part 4)

VEX VR Color Disk Transfer (VR Series Part 5)

VEX VR Dynamic Maze (VR Series Part 6)

   If interested, I have an academic paper on Spirolaterals that can be obtained free by sending an email request to