LOGO Procedures & Activities


Definitions for concepts used in LOGO:


As examples of these concepts are defined in terms of a LOGO program, it may be useful to cut and paste these programs into the LOGO commander and execute them so that you can visualize the examples.

arc: a curved line that is a segment of a circle. An arc can be drawn in LOGO:
a) by using the arc or arc2 commands, for example: arc2 90 150 draws an arc of 90 degrees, 150 pixels in length.
b) by drawing an incomplete circle, for example: repeat 90[fd 2 rt 1] draws a 90 degree arc that is 180 pixels long.

circumference: the distance around the circle. In LOGO, for example: repeat 360[fd 1 rt 1] draws a circle with a circumference of 360 pixels. repeat 360[fd 3 lt 1] draws a circle with a circumference of 1080 pixels.
In LOGO, a 36 sided figure appears to be a circle. Therefore, a command such as: repeat 36[fd 10 rt 10] can be used to represent a circle. Note that the repetitions times the degress turned left or right will equal 360 degrees.

diameter: the longest distance from one end of a circle to the other. In LOGO the diameter can be drawn by drawing a circle, then turning the turtle inward 90 degrees and drawing a straight line. The diameter must be calculated before it can be accurately drawn. See below.

origin: the center of the circle.

pi(π) : A number, 3.141592..., equal to (the circumference) / (the diameter) of any circle.

radius: distance from the center (origin) of a circle to any point on the circumference. The radius is one half the diameter.

sector: is a portion of a circle, composed of an arc with two radius lines which meet at the origin. It is like a slice of pie (a circle wedge). Sectors are used in a pie graphs.

tangent of circle: a line perpendicular to the diameter that touches ONLY one point on the circle. For example: repeat 360[fd 2 rt 1]fd 150 bk 300



Formulas:
A2 + B2 = C2

C= the square root of A2 + B2

B2 = C2 - A2

A2 = C2 - B2



Problems:

What is the diameter of a circle whose circumference is 720 pixels?
C=π d
If c= 720 then d= 720/3.141592=229.2

To prove that our answer is correct, we draw a circle with a circumference of 720 pixels: repeat 720[fd 1 rt .5] Then we turn right 90 degrees and draw a line 229.2 pixels long. This line should bisect the circle without penetrating its sides. The entire program would be repeat 720[fd 1 rt .5]rt 90 fd 229.2


Draw a circle with a diameter of 150 pixels.
C=π d
C=3.141592 X 150=471.24
471.24/360=1.31
So, repeat 360[fd 1.31 rt 1]rt 90 fd 150

Draw a circle with a sector containing 20% of the area of the circle.
1. repeat 360[fd 1 rt 1] draws our circle
2. 20% of 360=72 is 20% of the circumference
3. 360/3.1416=114.59 is the diameter of our circle
4. 114.59/2=57.3 is the radius
5. repeat 72[fd 1 rt 1] draws the arc needed to construct our sector
6. lt 90 fd 57.3 gives us the radius needed to construct our sector
7. The entire LOGO program for a circle with a 20% sector is: repeat 360[fd 1 rt 1]rt 90 fd 57.3 bk 57.3 lt 90 repeat 72[fd 1 rt 1] rt 90 fd 57.3

To color our 20% sector red, we would add the following commands: pu lt 10 bk 10 setfloodcolor [255 0 0] pd fill.


Construct a pie graph with the pie having a circumference of 1080 pixels containing the following:
a) a sector containing 25%
b) a sector of 20%
c) a sector containing 55%
1. 1080/3.1416=343.77/2=171.89 is the radius
2. 25% of 360=90 repeat 90[fd 3 lt 1]
3. 20% of 360=72 repeat 72[fd 3 lt 1]
4. 55% of 360=198 repeat 191[fd 3 lt 1]

PROGRAM:
1. repeat 360[fd 3 lt 1] makes our circle with 1080 pixel circumference.
2. lt 90 fd 171.89 bk 171.89 rt 90 repeat 90[fd 3 lt 1] lt 90 fd 171.89 bk 171.89 rt 90 draws our 25% sector.
3. To make our second sector: repeat 72[fd 3 lt 1] lt 90 fd 171.89 bk 171.89 rt 90
4. The third sector: repeat 198[fd 3 lt 1]lt 90 fd 171.89 bk 171.89 (or just omit this as the remainder of the pie chart equals this sector).

To make our sectors different colors, with the pen where it is now, (assuming that the third sector was drawn) we would enter: pu lt 45 fd 50 setfloodcolor [255 0 0] pd fill pu bk 50 rt 90 fd 50 setfloodcolor [0 0 0] pd fill pu bk 50 lt 22 fd 200 setfloodcolor [0 255 0] pd fill.




Draw a circle with a circumference of 1080 pixels. Draw the tangent to this circle with a length equal to the diameter of the circle.
1. repeat 360[fd 3 lt 1] gives us a circle with a circumference of 1080.
2. 1080/3.1416=343.77 is the diameter of our circle (our radius is 171.89}
3. Our program should be: repeat 360[fd 3 lt 1] fd 171.89 bk 343.77
Now, draw a square around our circle using the tangent line: repeat 360[fd 3 lt 1] fd 171.89 bk 343.77 lt 90 repeat 3[fd 343.77 rt 90].



The hypotenuse is the longest side of a right triangle (a triangle which has a 90 degree angle). The hypotenuse is the side opposite the right angle.

The length of the hypotenuse of a right triangle can be found using the Pythagorean Theorem. The theorem states that the square of the length of the hypotenuse equals the sum of the squares of the lengths of the other two sides. In the Pythagorean Theorem, the hypotenuse is referred to with the letter c. The other two sides are called a and b.

Therefore, the Pythagorean Theorem is written:c2=a2 + b2
Therefore, if a=60 and b=80, then c2=360 + 640. Therefore, c2=1000 and c=100



PLANE FIGURES: Plane figures have only two dimensions, length and width. Examples are: triangle, quadrilateral, polygon, circle

1. Triangle -- plane figure enclosed by three straight lines

a) equilateral triangle has all three sides equal to each other. repeat 3[fd 100 rt 60]
b) isosceles triangle has two sides equal to each other.
c) scalene triangle has no sides equal to each other.
d) acute triangle has all angles < 90 degrees.
e) right triangle has one right angle and 2 acute angles
f) obtuse triangle has one angle >90 degrees and 2 angles < 90


2. Quadrilateral -- plane figure enclosed by four straight lines

a) parallelogram -- has opposite sides parallel to each other
b) rhombus parallelogram -- with all sides equal
c) square -- is rhombus with four right angles
d) rectangle -- is parallelogram with four right angles
e) trapezoid -- has two sides parallel and two sides not parallel


3. POLYGONS -- Plane figures with more than four sides.

pentagon -- 5-sided figure repeat 5[fd 100 rt 72]
hexagon -- 6-sided figure repeat 6[fd 100 rt 60]
heptagon -- 7-sided figure repeat 7[fd 75 rt 51.43]
octagon -- 8-sided figure repeat 8[fd 50 rt 45]
nonagon -- 9-sided figure repeat 9[fd 50 rt 40]
decagon -- 10- sided figure repeat 10[fd 50 rt 36]

4. Circle -- a figure having all points on its border equidistant from a given point called the origin (center of the circle). In LOGO a circle is a 360 sided figure. For example, repeat 360[fd 2 rt 1]



When making plane figures, the total of all angles must equal 360. For example, a square will have four 90 degree angles. In LOGO this will be: repeat 4[fd 200 rt 90]. A pentagon will have five angles. {360/5=72} Therefore, each angle will be 72 degrees. In LOGO this would be: repeat 5[fd 200 rt 72].

Make LOGO programs for each of the following:
1. nonagon
2. square
3. rectangle
4. hexagon
5. octagon
6. circle
7. right triangle
8. decagon




Back To LOGO Tutorial
LOGO Lessons
Common Color Chart
Rare Color Chart
Try These LOGO Commands
sum1no1nose@yahoo.com