Skip to main content

Square to rhombus; reflection about y=x

Short answer

Shear (e.g., x' = x + sh·y, y' = y + sh·x with equal factors) converts a square into a rhombus. Reflection about y = x is obtained by rotating −45°, reflecting about x-axis, rotating back 45°, resulting in matrix [0 1 0; 1 0 0; 0 0 1], i.e., (x,y) → (y,x).

Which transformation converts a square to a rhombus? Obtain the reflection matrix to reflect a point about the line y = x.

Square to rhombus

Shear (shearing) converts a square into a rhombus. A shear slides the layers of a figure in one direction. A shear in one direction only (for example x' = x + shx·y) turns a square into a parallelogram whose sides are no longer all equal. To get a rhombus, shear in both directions with the same factor:

x' = x + sh·y,  y' = y + sh·x        | 1  sh 0 |
                                     | sh 1  0 |
                                     | 0  0  1 |

For the unit square (0,0), (1,0), (1,1), (0,1) with sh = 0.5, the new vertices are (0,0), (1,0.5), (1.5,1.5), (0.5,1). The sides (1, 0.5) and (0.5, 1) both have length √1.25, so all four sides are equal but the angles are no longer 90°: the square has become a rhombus.

Reflection about the line y = x

The line y = x passes through the origin at 45°.

Method 1 (composite): M = R(45°) · Ref_x · R(−45°)

R(−45°) = |  0.7071  0.7071 |     Ref_x · R(−45°) = |  0.7071  0.7071 |
          | −0.7071  0.7071 |                       |  0.7071 −0.7071 |

R(45°)  = | 0.7071 −0.7071 |
          | 0.7071  0.7071 |

M = | 0.7071·0.7071 − 0.7071·0.7071   0.7071·0.7071 + 0.7071·0.7071 |   | 0 1 |
    | 0.7071·0.7071 + 0.7071·0.7071   0.7071·0.7071 − 0.7071·0.7071 | = | 1 0 |

Method 2 (geometry): the reflection interchanges the x and y coordinates, (x, y) → (y, x).

Answer:

Ref_{y=x} = | 0 1 0 |
            | 1 0 0 |
            | 0 0 1 |

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computer Graphics chapter 3 questions →