1 / 20

Recursive MATLAB program for building the Pythagoras Tree

This MATLAB program builds the Pythagoras Tree using recursion. It includes variations with different inclination angles and calculates the total area for each level.

aliceq
Download Presentation

Recursive MATLAB program for building the Pythagoras Tree

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Recursive MATLAB program for building the Pythagoras Tree Alexander Rozhok, IAN-103

  2. Figure overview

  3. Traditional Pythagoras Tree

  4. Total area remains the same for each level 0.125 0.125 0.125 0.125 0.25 0.25 0.125 0.125 0.25 0.25 0.5 0.5 0.125 0.125 1

  5. Pythagoras Tree variations with different angles of inclination

  6. MATLAB implementation

  7. Function header α

  8. Main function body

  9. Recursive function header α i-th level point1 point2

  10. Recursion depth control

  11. Finding the triangle vertex pcenter Our goal is to find the coordinates of pcenter so we would be able to build new squares α dirVector i-th level point2 point1

  12. Finding the coordinates of new squares p3 pcenter p2 i-th level point1 point2 Performing similar operation for the second square:

  13. The result

  14. The result

  15. The result

  16. The result

  17. The result

  18. The result

  19. The result

  20. Thank you for your attention!

More Related