Sezione 2. Capitolo 8
single
Challenge: Combined Transformations
Scorri per mostrare il menu
Compito
Scorri per iniziare a programmare
Practice combining geometric transformations on a quadrilateral and visualizing the result. You will use translation, rotation, and scaling matrices as a sequence to transform a shape and then plot both the original and transformed quadrilaterals.
- Convert the list of quadrilateral points to a NumPy array.
- Add a column of ones to convert to homogeneous coordinates.
- Initialize the combined transformation matrix as the identity matrix.
- Multiply the transformation matrices in the given sequence.
- Apply the combined transformation matrix to all points.
- Convert back from homogeneous coordinates to regular 2D coordinates.
- Prepare the original quadrilateral coordinates for plotting.
- Prepare the transformed quadrilateral coordinates for plotting, also closing the shape.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 2. Capitolo 8
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione