Computer Science, asked by vievekananda9678, 10 months ago

Write LOGO commands to draw these polygons : octagon

Answers

Answered by RewelDeepak
4

Answer:

Previously we had done creating a square and an equilateral triangle. ... An octagon has eight sides that are the same length and all the internal angles are also the same. Draw a blue filled regular octagon using the REPEAT command

Answered by Anonymous
4

LOGO command to draw a octagon is, REPEAT 8 [ fd 150 rt 45].

- There is a basic formula for drawing any kind of polygon in the LOGO software.

- First, determine the number of sides of the polygon which you want to draw.

Suppose,you want to draw an octagon which has 8 sides then start the command like this :

REPEAT 8.

- Then write a third bracket after the number of sides you have written before.

- In this third bracket you need to write two components, fd and rt.

Here, fd = length unit of a side of the polygon,you can enter any value of your choice eg. 50,100,150 etc.

And, rt = value of one internal angle of the polygon.

Internal angle = 360/ number of sides of the polygon.

Eg. For octagon the internal angle will be, = 360/8 = 45.

- Then with all the above mentioned components write the final command.

General form of the command :

REPEAT (Number of sides of the polygon) [ fd (length of one side) rt (value of one internal angle)].

Similar questions