Shapes and Rotations
Using
Python,
make the following functions:
- point_rotations(point, axis, angle) – rotates a
point
(two-float tuple) about an
axis
(two-float tuple) given the rotation
angle
(float, degrees), and returns the floating point coordinated of the rotated point
- make_triangles(center, sides, rotations, shade) – draws triangle with the given
center
(two-integer tuple), sides (float), angle of
rotation(s)
(float, degrees), and shade (color – three-integer tuple) onto the image
Note: You may only use
Image and Image.Draw
from the Pillow Library, and
sin, cos, and pi
from the Math Library.
An example of a possible output is also attached, as well as the specifics.
Extracted text:
Extracted text: Shapes and Rotations Using Python, make the following functions: point_rotations(point, axis, angle) – rotates a point (two-float tuple) about an axis (two-float tuple) given the rotation angle (float, degrees), and returns the floating point coordinated of the rotated point make_triangles(center, sides, rotations, shade) – draws triangle with the given center (two-integer tuple), sides (float), angle of rotation(s) (float, degrees), and shade (color – three-integer tuple) onto the image Note: You may only use Image and Image.Draw from the Pillow Library, and sin, cos, and pi from the Math Library. An example of a possible output is also attached, as well as the specifics. make_triangles((300, 300), 300, 0, (0,128,0)) make_triangles((300, 300), 300, 25, (0,0,255)) make_triangles((300, 300), 300, 50, (255,@,0)) make_triangles((300, 300), 300, 50, (0,0,0))