Question: PS1: Recursive Graphics (Pythagoras tree) In this assignment you will write a program that plots a Pythagoras tree (with and without recursion), as illustrated below.


PS1: Recursive Graphics (Pythagoras tree) In this assignment you will write a program that plots a Pythagoras tree (with and without recursion), as illustrated below. Then, write a program that will plots an asymmetric Pythagoras tree using rectangle as a base. The Pythagoras tree is named after the Greek mathematician Pythagoras because each triple of touching squares encloses a right triangle, in a configuration traditionally used to depict the Pythagorean theorem. It is a plane fractal constructed from squares invented by the Dutch mathematics teacher Albert E. Bosman in 1942. In 1957 Bosman published a book on Het wondere onderzoekingsveld der lakke meetkunde ('the wondrous exploration field of plane geometry) that contained a description of the Pythagorean tree. If the largest square has a size of L L, the entire Pythagoras tree fits snugly inside a box of size 6L x 4L. Your task is to write a program PTree.cpp with a recursive function pTree(), and a main() program that calls the recursive function. Your program shall take two command-line arguments L and N: L size of the base square (double) N the depth of the recursion PS1: Recursive Graphics (Pythagoras tree) In this assignment you will write a program that plots a Pythagoras tree (with and without recursion), as illustrated below. Then, write a program that will plots an asymmetric Pythagoras tree using rectangle as a base. The Pythagoras tree is named after the Greek mathematician Pythagoras because each triple of touching squares encloses a right triangle, in a configuration traditionally used to depict the Pythagorean theorem. It is a plane fractal constructed from squares invented by the Dutch mathematics teacher Albert E. Bosman in 1942. In 1957 Bosman published a book on Het wondere onderzoekingsveld der lakke meetkunde ('the wondrous exploration field of plane geometry) that contained a description of the Pythagorean tree. If the largest square has a size of L L, the entire Pythagoras tree fits snugly inside a box of size 6L x 4L. Your task is to write a program PTree.cpp with a recursive function pTree(), and a main() program that calls the recursive function. Your program shall take two command-line arguments L and N: L size of the base square (double) N the depth of the recursion
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
