---
title: "Square to rhombus; reflection about y=x"
subject: "Computer Graphics"
chapter: 3
key: "semester_5/computer_graphics:square-to-rhombus-reflection-y-x"
source: https://www.bctengineer.com/q/semester_5/computer_graphics/square-to-rhombus-reflection-y-x
site: BCT Engineering
---

# Square to rhombus; reflection about y=x

Computer Graphics · Chapter 3: Two –Dimensional Transformations

- Asked in: 2067 Mangsir (old course), 3+7 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/computer_graphics/square-to-rhombus-reflection-y-x
- Whole chapter: https://www.bctengineer.com/md/semester_5/computer_graphics/chapter-3

## Question

Which transformation converts a square to a rhombus? Obtain the reflection matrix to reflect a point about the line 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).

## Answer

#### 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:

```text
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°)

```text
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:**

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

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which transformation turns a square into a rhombus/parallelogram?
   A. Shearing
   B. Reflection
   C. Translation
   D. Rotation
   Answer: A. Shear slants the shape. (Key point: Shear)

2. What does x' = x + shx·y, y' = y do to (1,1) with shx = 1?
   A. Moves it to (1,2)
   B. Moves it to (2,1)
   C. Keeps it at (1,1)
   D. Moves it to (0,1)
   Answer: B. x' = 1 + 1 = 2. (Key point: X-shear)

3. What does reflecting about y = x do?
   A. Negates both
   B. Negates x only
   C. Interchanges x and y
   D. Doubles x
   Answer: C. (x,y) -> (y,x). (Key point: Reflection y=x)

4. How is the reflection matrix derived in the composite method?
   A. R(90°)·Ref_y
   B. S(1,-1)
   C. T(1,1)
   D. R(45°)·Ref_x·R(-45°)
   Answer: D. Rotate the line to the x-axis, reflect, rotate back. (Key point: Method)

## Related in Computer Graphics

- [Composite matrix: reflection about y=mx+c](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Areflection-about-y-mx-c) — Computer Graphics, chapter 3, asked 2×
- [2D reflection matrices and line y+x=0](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Areflection-matrices-axes-y-plus-x) — Computer Graphics, chapter 3
- [Reflect triangle about 3X-4Y+8=0](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Areflect-triangle-3x-4y-8) — Computer Graphics, chapter 3, asked 2×
- [Reflect triangle about y=x+2](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Areflect-triangle-y-x-plus-2) — Computer Graphics, chapter 3
- [Reflect object about y=x+1](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Areflect-object-y-x-plus-1) — Computer Graphics, chapter 3
- [Specular reflection](https://www.bctengineer.com/question.md?key=semester_5%2Fcomputer_graphics%3Aspecular-reflection-expression) — Computer Graphics, chapter 8, asked 4×

## Related in other subjects

- [4-point DFT by linear transformation](https://www.bctengineer.com/question.md?key=semester_4%2Fsignals_and_systems%3Adft-linear-transformation) — Signals and Systems, chapter 3
- [Perpendicular from point to line](https://www.bctengineer.com/question.md?key=semester_2%2Fmathematics%3Aperpendicular-from-point-line) — Mathematics, chapter 3, asked 5×
- [Point transformation rectangular-spherical](https://www.bctengineer.com/question.md?key=semester_3%2Felectromagnetism%3Acoordinate-point-transform-spherical) — Electromagnetism, chapter 1
- [Inductance matrix of 500 kV bundled line](https://www.bctengineer.com/question.md?key=semester_8%2Fhigh_voltage_engineering%3Ainductance-matrix-500kv) — High Voltage Engineering, chapter 5, asked 3×
