How do I scale a triangle given its cartesian cooordinates?

3.3k Views Asked by At

Given the cartesian $(x,y)$ coordinates of three points $a, b$ and $c$ that form an equilateral triangle $ABC$, how do I scale them using its center point so that its position on the cartesian plane is maintained?

Multiplying each point's $X$ and $Y$ coordinate changes the triangle's relative position to the origin.

Thus; How do I scale my triangle so that center point's ($P$) distance to the origin of my plane is maintained?

2

There are 2 best solutions below

0
On BEST ANSWER

If $ (x_1, y_1), (x_2,y_2),(x_3,y_3) $ are the three vertices and its center of gravity has coordinates ( any defined center can be chosen as magnification/zoom center ):

$ (\bar x, \bar y)=[ (x_1 + x_2 + x_3)/3, (y_1 +y_2 +y_3)/3 ]$

The new zoomed coordinates (magnified with respect to origin in similitude) should be shifted back:

$ [ (m x_1-\bar x, m y_1-\bar y), (m x_2-\bar x,m y_2 - \bar y),(m x_3-\bar x,m y_3-\bar y) ] . $

0
On

Multiplying would work if $P$, the center of mass, were at the origin. I denote by $x$ the coordinate of any point $X$ (imagine it is a vector, or a complex number). So $p=\frac{a+b+c}{3}$.

The new coordinate for $x$ is denoted $x'$. So shift to the center $(x-p)$, scale with $s$ the scale factor $s.(x-p)$, shift back (apply $-p$ to the result), so coordinate-wise we have $x'=s.(x-p)+p$. Alternatively $x'=s.x-(s-1).p$.

With this notation, it is easy to see that:

  • if $p=(0,0)$, a simple scaling on the vertices of the triangle suffices,
  • if $s=1$, the coordinates are unchanged.