ME3430: Introduction to Computational Methods Project #1 – the Fibonacci Spiral
As a part of a novel pump design, we are to create a drawing of a spiral. Due to manufacturability reasons, the shape is not a perfect spiral, but is a combination of 90o circular arcs (Fibonacci spiral). The project is in two parts
Part 1 ( This is going to be used later in the complete project, and it does not yet involve the spiral.)
Write a function that takes any matrix of coordinates, scales, rotates it and shifts it to a desired location. The matrix of coordinates will be of size (2xn), in the form XY = …
The inputs to the function will include XY, the scaling factor, rotation angle, shifting amount in x and shifting amount in y. The output is the matrix containing the modified coordinates.
Note: This is combining everything we did in Activity 5 and turning it into a function. (You can test it on any set of coordinates during its development, for example the square in activity 5, or the star in activity 3.)
Part 2 (Complete Project)
…
Steps for part 2
• Create x and y coordinates of points on a 90° degree circular arc with R=1, in the first quadrant (where x>0, y>0), centered at (0, 0). (Choose an appropriate
number of points to get a smooth arc.)
• Calculate the first n Fibonacci numbers and save them in a vector.
• Create vectors that list the x and y center locations of each arc.
• Using the function created in part 1 as a sub-function, transform (rotate, scale, shift) the initial arc multiple times to draw the Fibonacci spiral to n iterations.
• Name your file: lastname_project1.m. Include appropriate comments to describe the functions and your steps.
What the result will look like:
This plot has a title that says “The Fibonacci Spiral”. The spiral should have a line width of 2. The function shall not produce any data in the command window, nor produce any variables in the workspace.
Create a function that produces the Fibonacci spiral to n iterations, where n is the only function input.
The Fibonacci spiral: an approximation of the golden spiral, created by drawing 90° circular arcs connecting the opposite corners of squares in the Fibonacci tiling. This graphed example uses arcs of sizes 1, 1, 2, 3, 5, 8, 13, 21, and 34. (The program will be able to handle as many pieces as the user wants.)