TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Flowgorithm

Draw Circle using Flowgorithm Turtle

Overview

In this tutorial, we will learn how to draw a circle using Flowgorithm Turtle. We will follow a simple algorithm to draw the circle. The turtle in a loop turns a small degree turn_angle and draws a small arc. The turtle should cover 360 degrees to draw the complete circle in the loop.

Let’s assume the loop iterates n times.

The turtle turns an angle: turn_angle

We have to choose the iterations n and the turn angle such that

360 = n * turn_angle

To draw a complete circle the turtle should turn 360 degrees in the loop. We choose the small turn angle to make the circle look smooth. For example, in the example, the number of iterations = 360 and the turn_angle is 1 degree. If the turtle doesn’t cover the 360 degrees it would draw a circular arc.

Pseudocode

The pseudocode for the flowchart is as follows:

// Draw Circle Flowgorithm Flowchart
Declare Integer i

For i = 1 To 360
Turn Right 1
Draw 10
End For

Flowchart

The Flowgorithm flowchart to draw a circle is as follows:

Declare a loop counter variable: i

Initialize a For loop to make it run 360 times.

In the For loop statement, the turtle turns a small degree and draws a small line. Add a Turn symbol and the Forward symbol. The turn degrees and the iterations should cover 360 degrees to draw the complete circle.

Save the Flowchart.

Run the flowchart.

Draw Circle Flowgorithm Flowchart

Let’s draw a circle with a specified radius

Now that we know how to draw a circle, in the next version we will draw a circle of a specific radius. We will prompt the user to enter the radius of the circle. Let’s calculate the arc length that the turtle draws in the loop.

Let’s assume the circle radius is: r

Circumference of the circle = 2 * pi* r

So the length of the arc that the turtle draws in the loop is: (2*pi*r)/360

 

Draw Circle with Specific Radius

—

Flowgorithm Tutorials

Flowgorithm flowchart tutorials on this website:

https://www.testingdocs.com/flowgorithm-flowchart-tutorial/

Flowgorithm Website

For more information on the Flowgorithm tool, please visit the official website at:

http://flowgorithm.org/

Related Posts

Flowgorithm Breakpoint Symbol

Flowgorithm /

Flowgorithm Conditional Breakpoint Statement

File Read Declare Variables

Flowgorithm /

Flowgorithm Read Numbers from File Example

File Search Input File Flowgorithm

Flowgorithm /

Search Text File Flowchart Example

Flowgorithm Turtle Graphics Symbols

Flowgorithm /

Flowgorithm Turtle Graphics Symbols

Draw Symbol Flowgorithm

Flowgorithm /

Draw Parallel Lines using Flowgorithm Graphics

‹ Draw Parallel Lines using Flowgorithm Graphics› Flowgorithm Turtle Graphics Symbols

Recent Posts

  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • RAPTOR Editions
  • Flowgorithm Conditional Breakpoint Statement
  • Flowgorithm Read Numbers from File Example
  • Search Text File Flowchart Example
  • Flowgorithm Turtle Graphics Symbols
  • Draw Circle using Flowgorithm Turtle
  • Draw Parallel Lines using Flowgorithm Graphics

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version