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

single

Challenge: Translation

Glissez pour afficher le menu

Tâche

Glissez pour commencer à coder

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.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 2
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

some-alt