Sektion 2. Kapitel 4
single
Challenge: Rotation
Stryg for at vise menuen
Opgave
Swipe to start coding
Practice applying geometric transformations by rotating a triangle by 90 degrees. Use the rotate_point function to rotate each vertex of the triangle.
- The
rotate_trianglefunction must take a list of three points and an angle in degrees. - For each point in the triangle, use
rotate_pointto find its new position after rotation. - Collect the rotated points into a new list and return it.
- After rotating the triangle, use
plot_trianglesto display both the original and rotated triangles.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 2. Kapitel 4
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat