Making Shapes Using Python, I’ve been trying to create this pattern. However, I can only do it manually, as opposed to the easier way. Supposedly, I must create a function with the following attributes – pivot, width-height, rotations, color. However, I can’t do the function and only managed to draw the patter manually. I’ve attached the pattern and my current code (the manual one – I need help in creating the function). Problem: Make the function with the following attributes (pivot, width_height, rotations, color) and call it to the main function to recreate the following patterns. You are limited to the PIL.Image and PIL.ImageDraw. Note: Do not use the Turtle library. You can use cos, sin, and pi from the math library. Hints: pivot – the pivot point is a two-integer tuple width_height – a float – arbitrary scaling variable rotations – angle of rotation – float in degrees color – a three-integer tuple
Making Shapes
Using Python, I’ve been trying to create this pattern. However, I can only do it manually, as opposed to the easier way. Supposedly, I must create a function with the following attributes – pivot, width-height, rotations, color. However, I can’t do the function and only managed to draw the patter manually. I’ve attached the pattern and my current code (the manual one – I need help in creating the function).
Problem:
Make the function with the following attributes (pivot, width_height, rotations, color) and call it to the main function to recreate the following patterns. You are limited to the PIL.Image and PIL.ImageDraw. Note: Do not use the Turtle library. You can use cos, sin, and pi from the math library.
Hints:
- pivot – the pivot point is a two-integer tuple
- width_height – a float – arbitrary scaling variable
- rotations – angle of rotation – float in degrees
- color – a three-integer tuple
Step by step
Solved in 3 steps with 2 images