Chapter 6
Chapter 6
Chapter 6
Line
Rectangle
Polygon
Square
Here Translation coordinates (Tx, Ty, Tz) are also called “Translation or Shift Vector.”
Example: A Point has coordinates P (1, 2, 3) in x, y, z-direction. Apply the translation with a
distance of 2 towards x-axis, 3 towards y-axis, and 4 towards the z-axis. Find the new
coordinates of the point?
Solution: We have,
Point P = (x0, y0, z0) = (1,2,3)
Shift Vector = (Tx, Ty, Tz)
Let us assume the new coordinates of P = (x1, y1, z1)
Now we are going to add translation vector and given coordinates, then
X1 = x0 + Tx = (1 + 2) = 3
Y1 = y0 + Ty = (2 + 3) = 5
Z1 = z0 + Tz = (3 + 4) = 7
Thus, the new coordinates are = (3, 5, 7)
3D Rotation
The 3D rotation is different from 2D rotation. In 3D Rotation we also have to define the angle of
Rotation with the axis of Rotation.
For Example- Let us assume,
The initial coordinates of an object = (x0, y0, z0)
The Initial angle from origin = β
The Rotation angle = θ
The new coordinates after Rotation = (x1, y1, z1)
In Three-dimensional plane we can define Rotation by following three ways-
X-axis Rotation: We can rotate the object along x-axis. We can rotate an object by using
following equation-
We can represent 3D rotation in the form of matrix-
Y-axis Rotation: We can rotate the object along y-axis. We can rotate an object by using
following equation-
We can represent 3D rotation in the form of matrix-
Z-axis Rotation: We can rotate the object along z-axis. We can rotate an object by using
following equation-
We can represent 3D rotation in the form of matrix-
Example: A Point has coordinates P (2, 3, 4) in x, y, z-direction. The Rotation angle is 90
degrees. Apply the rotation in x, y, z direction, and find out the new coordinates of the point?
Solution: The initial coordinates of point = P (x0, y0, z0) = (2, 3, 4)
Rotation angle (θ) = 90°
For x-axis-
Let the new coordinates = (x1, y1, z1) then,
x1= x0 = 2
y1= y0 x cosθ – z0 x sinθ = 3 x cos90°– 4 x sin90° = 3 x 0 – 4 x 1 = -4
z1= y0 x sinθ + z0 x cosθ = 3 x sin90°+ 4 x cos90° = 3 x 1 + 4 x 0 = 3
The new coordinates of point = (2, -4, 3)
For y-axis-
Let the new coordinates = (x1, y1, z1) then,
X1= z0 x sinθ + x0 x cosθ = 4 x sin90° + 2 x cos90° = 4 x 1 + 2 x 0 = 4
y1= y0 = 3
z1= y0 x cosθ – x0 x sinθ = 3 x cos90°– 2 x sin90° = 3 x 0 – 4 x 0 = 0
The new coordinates of point = (4, 3, 0)
For z-axis-
Let the new coordinates = (x1, y1, z1) then,
x1= x0 x cosθ – y0 x sinθ = 2 x cos90° – 3 x sin90° = 2 x 0 + 3 x 1 = 3
y1= x0 x sinθ + y0 x cosθ = 2 x sin90° + 3 x cos90° = 2 x 1 + 3 x 0 = 2
z1= z0 =4
The New Coordinates of points = (3, 2, 4)
3D Scaling
The 2D and 3D scaling are similar, but the key difference is that the 3D plane also includes the z-
axis along with the x and y-axis.
In scaling, we can expend or compress the size of any object. We can apply scaling on the object
by multiplying the original coordinates with scaling factors.
The term scaling factor is used to define whether the size of the object is increased or decreased.
We can represent the scaling factor by ‘Sx’ for the x-axis, ‘Sy’ for the y-axis, and ‘Sz’ for the z-
axis.The increment and decrement of an object is depends on two conditions. They are-
If scaling factor (Sx, Sy, Sz) > 1, then the size of the object increased.
If scaling factor (Sx, Sy, Sz) < 1, then the size of the object decreased.
X1 = x0. Sx
Y1 = y0. Sy
Z1 = z0. Sz
Matrix representation of 3D Scaling-
Example: A 3D object that have coordinates points P(1, 4, 4), Q(4, 4, 6), R(4, 1, 2), T(1, 1, 1)
and the scaling parameters are 3 along with x-axis, 4 along with y-axis and 4 along with z-axis.
Apply scaling to find the new coordinates od the object?
Solution: we have,
The initial coordinates of object = P (1, 4, 4), Q (4, 4, 6), R (4, 1, 2), S (1, 1, 1)
Scaling factor along with x-axis (Sx) = 3
Scaling factor along with y-axis (Sy) = 4
Scaling factor along with z-axis (Sz) = 4
Let the new coordinates after scaling = (x1, y1, z1)
For coordinate P- x1 = x0 x Sx = 4 x 3 = 12
y1 = y0 x Sy = 4 x 4 = 16
x1 = x0 x Sx = 1 x 3 = 3
z1 = z0 x Sz = 6 x 4 = 24
y1 = y0 x Sy = 4 x 4 = 16
The new coordinates = (12, 16, 24)
z1 = z0 x Sz = 4 x 4 = 16
The new coordinates = (3, 16, 16) For coordinate R-
x1 = x0 x Sx = 4 x 3 = 12
For coordinate Q-
y1 = y0 x Sy = 1 x 4 = 4 x1 = x0 x Sx = 1 x 3 = 3
z1 = z0 x Sz = 2 x 4 = 8 y1 = y0 x Sy = 1 x 4 = 4
The new coordinates = (12, 4, 8) z1 = z0 x Sz = 1 x 4 = 4
The new coordinates = (3, 4, 4)
For coordinate S-
Thus, the new coordinates after scaling = P (3, 16, 16), Q (12, 16, 24), R (12, 4, 8), S (3, 4, 4).
3D Reflection
The Reflection is a mirror image of the original object. We can differentiate 2D and 3D
reflection by adding Z-axis. The Z-axis shows the depth of the surface. In the Reflection process,
the size of the object does not change.
Reflection along with xy Plane: In the xy plane reflection, the value of z is negative.
Reflection along with xz Plane: In the xz plane reflection the value of y is negative.
Example: A 3D triangle with coordinates points P (4, 5, 2), Q (7, 5, 3), R (6, 7, 4). Apply
reflection on XY plane and find the new coordinates of triangle?
Solution: We have,
Reflection Plane = xy