Category Archives: Assignment

N dragon curve using turtle graphics

screen-shot-2016-09-19-at-8-14-42-pm

Dragon curve. Use the program, Dragon.java that reads in a command-line parameter N and plots the order N dragon curve using turtle graphics. The dragon curve was first discovered by three NASA physicists (John E. Heighway, Bruce A. Banks, and William G. Harter) and later popularized by Martin Gardner in Scientific American (March and April 1967) and Michael Crichton in Jurassic Park.
Describe in a short paragraph how the program works.
dragon_curve_animation

220px-fractal_dragon_curve

400px-dragoncurve_animation

Wikipedia

 

 

 

 

 

 

 

 

 

 

Turtle Graphics: Koch – Circle Approximation

 

Screen Shot 2015-09-07 at 9.38.05 PM   Screen Shot 2015-09-07 at 9.41.17 PM

Classwork:

Set up your working environment

1. Create a folder to hold your projects for this class, Algorithms.
2. Create a folder for ADTs.
3. Create a project in ADTs with the classes presented in the pdf above. Ensure that your project contains the files needed to test your classes. Check edmodo.com for due dates.
4. Write your own main method to test your classes. Ensure you have good documentation.
5. Submit your work to edmodo.com.

Guidelines to submit your work:

  1. Find the assignment’s post
  2. Copy and paste your work on the post.
  3. If the assignment is a program, you also have to attach the file to the post.
  4. The file has to have your initials followed an underscore and the program name.

Every program has to have a header:

  • Assignment description
  • Author’s name
  • Date
  • If the program doesn’t run successfully, write a short paragraph as part of the program header explaining the problem.

Input and output:

  • If the assignment requires input and output is generated, both should be included in your program as comments.
  • If the output is an image or animation, submit a screen shot.

Using Turtle ADT
turtle_draw papert
Seymour Aubrey Papert (February 29, 1928 – July 31, 2016)
was a South African-born American mathematician, computer scientist, and educator, who spent most of his career teaching and researching at MIT.[1] He was one of the pioneers of artificial intelligence, and of the constructionist movement in education. He was co-inventor, with Wally Feurzeig, of the Logo programming language.
Logo
Papert used Piaget’s work in his development of the Logo programming language while at MIT. He created Logo as a tool to improve the way children think and solve problems. A small mobile robot called the “Logo Turtle” was developed, and children were shown how to use it to solve simple problems in an environment of play. A main purpose of the Logo Foundation research group is to strengthen the ability to learn knowledge.[7] Papert insisted a simple language or program that children can learn—like Logo—can also have advanced functionality for expert users.
From Wikipedia

Assignment:
Regular n-gons. Ngon.java takes a command-line argument n and draws a regular n-gon using turtle graphics or the Std library. By taking n to a sufficiently large value, we obtain a good approximation to a circle. Show your images as n increases. Implement an algorithm to find the smallest value for n to get the best approximation to a circle.
Document clearly your proof.
NOTE: only show few images

Homework:
Set up your working environment in your own computer.
Assignment:
Recursive graphics. Koch.java takes a command-line argument n and draws a Koch curve of order n. A Koch curve of order order 0 is a line segment. To form a Koch curve of order n:
Draw a Koch curve of order n−1
Rotate 60° counterclockwise
Draw a Koch curve of order n−1
Rotate 120° clockwise
Draw a Koch curve of order n−1
Rotate 60° counterclockwise
Draw a Koch curve of order n−1
Below are the Koch curves of order 0, 1, 2, and 3.
As the order of the curve increases, how is the area between the curve and the “x-axis” affected? Modify the Koch ADT to include a method that implements the area computation to assist you in answering the question.
Document clearly your proof.

Koch Snowflake

 

Mandelbrot Set

Faster Madelbrot

Speed up Mandelbrot by performing the computation directly instead of using Complex. Compare. Incorporate periodicity checking or boundary tracing for further improvements. Use divide-and-conquer: choose 4 corners of a rectangle and a few random points inside; if they’re all the same color, color the whole rectangle that color; otherwise divide into 4 rectangles and recur.

screen-shot-2016-09-19-at-8-43-22-pm