Points and Planes in 3D
Points in 3D
• World points at 3-dimensional entities Y
• In homogeneous coordinates,
or in general
X
where
Z (1,5,2)Τ or
• denotes ideal points
(10, 50, 20, 10)Τ
• The vector space is defined as
Planes in 3D
• Planes in 3D are natural extension of lines in 2D
• A plane in 3-space may be written as
• Plane has 3 degrees of freedom (3 independent ratios,
because scale does not matter)
• Thus the representation of a plane is a homogeneous 4-
vector
• Homogenizing by replacements
• Equation of Plane:
3 Points Define a Plane
• Suppose 3 points lie on a plane
• For each point:
• Stacking these
equations together:
• Thus plane parameters can be found as 1-dimensional
(right) null space of this 3x4 matrix
3 Planes define a point
• The point of intersection of 3 planes will satisfy the
following equation
• Thus the point of intersection is the 1-dimensional (right)
null space of this 3x4 matrix
Transformation of a Plane under
• Under a point transformation
a plane will transform as
• Proof: Analogous to line transformation in
Parameterized Points on a Plane
• The points X on a plane π can be written as
where the columns of generate the 4x3 null space of πΤ.
That is
• The 3-vector parameterizes points on the plane π
3D Transformations
3D Transformations
• Scaling
• Translation
3D Rotation Y
(X', Y', Z')
• Rotation about Z-axis (X, Y, Z)
• Z coordinate will not change
Z' = Z
• If we ignore the Z coordinate, X
then this is a 2D
transformation in the XY
plane Z
Positive rotation is counter clockwise when looking down from the positive side of
axis of rotation towards origin
Rotation about Principal Axes
Y X Z
β ϒ
X Z Y
Z Y X
Concatenation of Rotations
• Example: Rotation about X by ϒ followed by rotation about Y
by β followed by rotation about Z by θ
Properties of Rotation
• Rotation matrices are orthonormal with a determinant of +1
• Inverse of a rotation matrix is its transpose, i.e.
• Rotation matrix
has 9 terms, but 6 orthonormality constraints
• Degrees of freedom = 9 – 6 = 3
Properties of Rotation Matrices
• Concatenation of rotation matrices is also a rotation matrix,
i.e. matrix remains orthonormal with determinant of +1
• [proof ?]
Interpreting Rotation
• Given a general rotation matrix, how can we visualize the
transformation?
Properties of Rotation Matrices
• A rotation matrix transforms its own rows onto the principal
axes
r11 r12 r13 r11 1 r11 r12 r13 r21 0
r r22 r23 r12 ?0 r r22 r23 r22 1
21 21
r31 r32 r33 r13 0 r31 r32 r33 r23 0
r11 r12 r13 r31 0
r r22 r23 r32 0
21
r31 r32 r33 r33 1
Properties of Rotation Matrices
• A rotation matrix transforms its own rows onto the principal
axes
é r r r13 ù
ê 11 12 ú
ê r21 r22 r23 ú
ê ú
êë r31 r32 r33 úû
Rotation about an arbitrary axis
• Any combination of rotations is also a rotation, hence it can
be described as a rotation about a single axis n = (n1, n2, n3)T
by an angle θ
• Without loss of generality, n can be a unit vector, so n has 2
parameters and the third parameter is θ
Rotation about Arbitrary Axis
To rotate about an axis n by an angle
1. Set up rotations such that n rotates onto one of the
principal axes [How?]
2. Rotate about that axis by
3. Undo the transformations in step 1
Short cut to this process is the Rodriguez Formula
Rotation about Arbitrary Axis
• Question: Given an arbitrary 3D rotation matrix, how can we
find out the axis n and the angle that represents this
rotation?
• Use property that axis of rotation does not move during a
rotation:
• Hence, n is an eigenvector of corresponding to the
eigenvalue of +1
Eigenvalues of Rotation Matrix
• A rotation matrix has the following 3 eigen values:
[easy to show for the case of ]
• The angle of rotation about the axis n can be found from
the remaining two eigenvalues
Example
• Finding the axis of rotation and angle of rotation about the
axis
• Let us first verify whether this is a valid rotation matrix
>> R*R’
ans =
1 0 -5.5511e-17
0 1 0
-5.5511e-17 0 1
Example
>> R'*R
ans =
1 -5.5511e-17 0
-5.5511e-17 1 -5.5511e-17
0 -5.5511e-17 1
>> det(R)
ans =
1
Example
• Now find axis of rotation
>> [v,d] = eig(R)
v =
-0.70627 -0.70627 -0.048556
0.016684 - 0.61801i 0.016684 + 0.61801i -0.48534
-0.030008 - 0.3436i -0.030008 + 0.3436i 0.87297
d =
-0.56695 + 0.82376i 0 0
0 -0.56695 - 0.82376i 0
0 0 1
• Hence the axis of rotation is [-0.048556, -0.48534, 0.87297]T
Example
• Let us verify whether it is valid axis of rotation or not
>> R*n
ans =
-0.048556
-0.48534
0.87297
• OR
>> norm(n - R*n, 2)
ans =
1.9638e-16
Example
• The angle of rotation can be computed by looking at the
other two eigenvalues
-0.56695 ± 0.82376i
• Note that the cos value is negative, which means the angle
is in the 2nd or 3rd quadrant
>> rad2deg(acos(real(d(1,1))))
ans =
124.54
• So the angle is either 124.54o or 180+(180-
124.54)=235.46o
Example
• To check which is the correct angle and sign of n, we can check for
consistency in Rodriguez formula
>> n = v(:,3);
>> theta = acos(real(d(1,1)));
>> Nx = [0 -n(3) n(2); n(3) 0 -n(1); -n(2) n(1) 0];
>> r = eye(3) + sin(theta) * Nx + (1 - cos(theta)) * Nx * Nx
r=
-0.56325 -0.68219 -0.46622
0.75604 -0.19784 -0.62391
0.33338 -0.7039 0.6272
• Note that this rotation is not the same as the original rotation matrix
>> R
R=
-0.56325 0.75604 0.33338
-0.68219 -0.19784 -0.7039
-0.46622 -0.62391 0.6272
Example
• Try the 2nd possibility
>> theta = 2*pi - theta;
>> r = eye(3) + sin(theta) * Nx + (1 - cos(theta))
* Nx * Nx
r =
-0.56325 0.75604 0.33338
-0.68219 -0.19784 -0.7039
-0.46622 -0.62391 0.6272
>> norm(R-r,2)
ans =
3.6858e-16
• Hence, axis of rotation is [-0.048556, -0.48534, 0.87297]T with angle
of rotation being 235.46o
Summary: 3D Rotation Matrices
• Rotations about Principal Axes • Any 3D rotation matrix can be described
cos sin 0 0 1 0 0 0 cos 0 sin 0 as rotation about an axis n by an angle
sin cos 0 0 cos sin 0 0 0
0 1 0
• To rotate about given axis n by :
0 0 1 0 0 sin cos 0 sin 0 cos 0
– Rotate axes onto a principal axis
0 0 0 1 0 0 0 1 0 0 0 1
• by composing appropriate matrix through
About origin, in right handed coordinate system, counter cross products
clockwise when looking towards origin from positive axis
– Rotate about principal axes and then
• Rotation matrix is orthonormal with
undo the earlier transformation
Determinant of +1 and 3 dof
– OR use Rodriguez formula
• Inverse of a rotation matrix is its
• To compute n and from a 3D rotation
transpose
matrix
• Concatenation of Rotations is also a
– n is the eigenvector corresponding to
rotation
the real eigenvalue of 1
• IMP: A rotation matrix transforms its
– can be computed by the other 2
own rows onto the principal axes eigenvalues, which are
cos i sin
– To disambiguate angle values, check
for consistency with Rodriguez formula
Hierarchy of 3D Transformations