Circle and its applications

This lesson is the continuation of the Gyro sensor and geometric figures lesson. The goal is the same: the robot should delineate: an equilateral triangle, a square, a regular pentagon, etc. but now we don’t use a gyro sensor.

Prerequisite

What students should know before

  • calculate the circumference of a circle

  • calculate arc length

  • regular polygon

  • topic: Basic - Motors, Gyro and geometric figures

Time constraints:

  • starting from 45 min - single lesson

Preparing For This Tutorial:

  • The LEGO Mindstorm EV3 Robot that coincides with this tutorial comes from building specific sections found in the LEGO Mindstorm Education Core Set building instructions (I’ll refer to use the Base model).

Effects

Mathematics - In this lesson you will use information related to a circle and regular shapes. Computer science - This lesson will help your students to create a programme to draw some regular polygons without using a gyro sensor (compare lesson: Gyro sensor and geometric figures).

Exercise

Create a program that will make the robot run around the circumference of: an equilateral triangle, a square, a pentagon and other polygons.

Example solution

Part 1

Mathematics

In order to define the robot’s trace as an equilateral triangle or any regular n-angle firstly the robot determines the segment and next it turns by a certain angle. It should be repeated for the appropriate number of times according to the drawn geometric figure.

Firstly, we’ll check how to draw for example a 30-centimeter segment (the length of course depends on you). We need to know how many turns the wheel should make.

Circumference - the distance around the edge of a circle. To calculate the circumference of a circle, use the formula \(C\ = \ \pi d\), where C is the circumference, d is the diameter, and \(\pi\) we put 3.14. Using this formula we can write that

\(30\ cm\ = \ \text{πdx}\) (1)

where \(x\) is a number of rotation of robot’s wheel, \(d = \ 5.6\ cm\)(diameter of robot’s wheel) and \(\ \pi = 3.14\), so it is easy to compute \(x\).

Computer science

Step 1:

Create a programme (function) to make the robot move straight given distance. Variable distance should be an argument of the function.

Program figure_1.py

image0

Summary

We have just learnt how to configure a motor to create a programme to make the robot draw sections of different lengths.

Part 2

Mathematics

Now we will investigate the second part i.e. turn by a certain angle. One wheel of the robot doesn’t turn. We need to calculate how many turns the second robot’s wheel should make.

A circle is 360° all the way around; therefore, if you divide an arc’s degree measure by 360°, you find the fraction of the circle’s circumference that the arc makes up. Then, if you multiply the circle’s circumference by that fraction, you get the length along the arc. Formula is

\(arc\ length\ = \ 2\ \pi\ R\ (\ \theta\ /360\ )\),

where \(R\) equals to the radius of the circle and \(\theta\)- equals the measurement of the arc’s central angle, in degrees. Note, \(R\) is not the radius of the robot’s wheel, it is the radius of the wheel whose fragment is delineated by the robot during the turn (so there is - Wheel track - means the shortest distance between the center of the tire treads on the same axle.

image1

The robot wheel moves on this arc. It travels a path whose length is equal to circumference multiplied by number of rotations \(arc\ length\ = \ \pi dx\) where \(x\) is the number of rotation of robot’s wheel, \(d\) is the diameter of robot’s wheel and \(\pi = 3.14\).

It is known that diameter is equal to radius multiplied by 2. Let denote by r radius of robot’s wheel, so \(arc\ length\ = \ 2\ \pi\ r\ x.\)Comparing both formulas we get

\(2\ \pi\ R\ (\ \theta\ /360\ )\ = \ 2\ \pi\ r\ x\),

so

\(x = \ (R\ /\ r)\ (\ \theta\ /360\ )\),

where

\(r\)is radius of robot’s wheel

\(\text{R\ }\)is radius of the wheel whose fragment is delineated by the robot during the turn (robot’s wheel track)

\(\theta\)- equals to the measurement of the arc central angle (in degrees)

\(x\)is the number of rotations robot’s wheel.

Computer science

Step 1:

Create a programme(function) to make the robot turn 90 degrees. Try this programme with other angle measures (e.g. 360, 180, 270○,,-90).

Program figure_2.py

image2image3

Note. Modify your programme - assume that one wheel turns left, and second right.

Step 3.

Create a programme to make the robot draw an equilateral triangle, square, regular pentagon, etc. The input will be the number of angles of the figure. Firstly we have to compute the measure of one angle according the lesson - Gyro and figure it is equal \(180 - \frac{180 \cdot (n - 2)}{n} = \frac{360}{n}\). The input will be the number of angle, so we have to compute the measure of the one angle in the figure (for details see lesson Gyro and geometric figures).

Program

image4

Summary

We have just learnt how to create a programme to make the robot draw any regular polygons.

Python code file (ev3dev2 library): Circle_app