Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Challenge: Translation | Geometric Transformations
Geometric Modelling with Python
Sezione 2. Capitolo 2
single

single

Challenge: Translation

Scorri per mostrare il menu

Compito

Scorri per iniziare a programmare

Translate a polygon by a given vector.

Given a polygon represented as a list of (x, y) tuples and a translation vector (dx, dy), create a new list of tuples representing the translated polygon.

  • For each point in polygon, add vector[0] to the x-coordinate and vector[1] to the y-coordinate.
  • Return a new list containing all the translated points.
  • The function must not modify the original polygon list.

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 2. Capitolo 2
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

some-alt