My textbook, as an example of function, says: "Let $X$ the set of the triangles in the plane and $Y$ the set of real numbers. Then the corrispondence $\text{triangle} \mapsto \text{perimeter}$ is a function from $X$ to $Y$."
I'm confused, because I knew that a function associate an element of $X$ to one and one only element of $Y$; but if I take the equilateral triangle of side length $4$ it has perimeter $12$, and if I take the right triangle with catheti $3$ and $4$ it has hypotenuse $5$ and so it has perimeter $12$ as well; so I have associated to two distincts element of the set "triangles of the plane" the same value $12$ of the set "perimeter", so this shouldn't be a function. Am I missing something or is there an error in my textbook?