Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Translation of Shapes | Geometric Transformations
Geometric Modelling with Python

Translation of Shapes

Glissez pour afficher le menu

Translation is a fundamental geometric transformation that shifts every point of a shape by the same distance in a specified direction. Mathematically, translating a shape means adding a fixed vector to each of its points.

  • If a point has coordinates (x, y) and you want to move it by a vector (dx, dy), the new coordinates become (x + dx, y + dy). This operation preserves the size, shape, and orientation of the figure—it simply moves the entire shape to a new location.

Suppose you have a triangle with vertices at (1, 2), (3, 5), and (5, 4). If you translate this triangle by the vector (2, -1), the new vertices will be (3, 1), (5, 4), and (7, 3). Each vertex is shifted to the right by 2 units and down by 1 unit. This simple addition works for any shape represented as a collection of points.

12345678910111213141516171819
def translate_polygon(polygon, dx, dy): """ Translates a polygon by a vector (dx, dy). Args: polygon: List of (x, y) tuples representing the polygon's vertices. dx: Translation in the x-direction. dy: Translation in the y-direction. Returns: List of (x, y) tuples representing the translated polygon. """ return [(x + dx, y + dy) for (x, y) in polygon] # Example usage: triangle = [(1, 2), (3, 5), (5, 4)] translated_triangle = translate_polygon(triangle, 2, -1) print("Translated triangle:", translated_triangle)
question mark

Which of the following statements about translation is correct?

Sélectionnez la réponse correcte

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 1

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

Section 2. Chapitre 1
some-alt