Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Introduction to Matrix Transformations | Linear Algebra Foundations
Mathematics for Data Science

bookIntroduction to Matrix Transformations

Matrices allow us to represent and manipulate linear transformations in space. They are core to systems of equations, geometry, and data science workflows.

What Is a Matrix?

A matrix is a rectangular array of numbers used to represent transformations or systems of equations.

A matrix equation can be written as:

Ax=bA \vec{x} = \vec{b}

Where:

  • AA is the coefficient matrix;
  • x\vec{x} is the vector of variables;
  • b\vec{b} is the vector of constants.

Matrix Representation of Linear Systems

Consider the linear system:

2x+y=5xy=12x + y = 5 \\ x - y = 1

This can be rewritten as:

[2111][xy]=[51]\begin{bmatrix} 2 & 1 \\ 1 & -1 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 5 \\ 1 \end{bmatrix}

Matrix Multiplication Breakdown

The multiplication of a matrix with a vector represents a linear combination:

[abcd][xy]=[ax+bycx+dy]=x[ac]+y[bd]\begin{bmatrix} a & b \\ c & d \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} ax + by \\ cx + dy \end{bmatrix} = x \begin{bmatrix} a \\ c \end{bmatrix} + y\begin{bmatrix} b \\ d \end{bmatrix}

Example System in Matrix Form

The system:

3x+2y=74xy=53x + 2y = 7 \\ 4x - y = 5

Can be expressed as:

[3241][xy]=[75]\begin{bmatrix} 3 & 2 \\ 4 & -1 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 7 \\ 5 \end{bmatrix}

Matrices as Transformations

A matrix transforms vectors in space.

For example:

A=[abcd],  v1=[11],  v2=[112]A = \begin{bmatrix} a & b \\ c & d \end{bmatrix},\ \ \vec{v_1} = \begin{bmatrix}1 \\ 1\end{bmatrix},\ \ \vec{v_2} = \begin{bmatrix}1 \\ \frac{1}{2}\end{bmatrix}

This matrix defines how the axes transform under multiplication.

Scaling with Matrices

To apply scaling to a vector use:

S=[sx00sy]S = \begin{bmatrix} s_x & 0 \\ 0 & s_y \end{bmatrix}

Where:

  • sxs_x is the scale factor in the x-direction;
  • sys_y is the scale factor in the y-direction.

Example: Scaling point (2, 3) by 2:

S=[2002],v=[23]S = \begin{bmatrix} 2 & 0 \\ 0 & 2 \end{bmatrix}, \quad \vec{v} = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

Then:

Sv=[46]S \vec{v} = \begin{bmatrix} 4 \\ 6 \end{bmatrix}

Rotation with Matrices

To rotate a vector by angle θ\theta around the origin:

R=[cosθsinθsinθcosθ]R = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}

Example: Rotate (2, 3) by 90°:

R=[cos90ºsin90ºsin90ºcos90º]=[0110],v=[23]R = \begin{bmatrix} \cos90º & -\sin90º \\ \sin90º & \cos90º \end{bmatrix} = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}, \quad \vec{v} = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

Then:

Rv=[32]R \vec{v} = \begin{bmatrix} -3 \\ 2 \end{bmatrix}

Reflection over the x-axis

Reflection matrix:

M=[1001],M = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix},

Using v=(2,3)\vec{v} = (2, 3):

Mv=[23]M \vec{v} = \begin{bmatrix} 2 \\ -3 \end{bmatrix}

Shearing Transformation (x-direction shear)

Shearing shifts one axis based on the other.

To shear in the x-direction:

M=[1k01]M = \begin{bmatrix} 1 & k \\ 0 & 1 \end{bmatrix}

If k=1.5k = 1.5 and v=(2,3)\vec{v} = (2, 3):

Mv=[6.53]M \vec{v} = \begin{bmatrix} 6.5 \\ 3 \end{bmatrix}

Identity Transformation

The identity matrix performs no transformation:

I=[1001]I = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}

For any vector v\vec{v}:

Iv=vI \vec{v} = \vec{v}

Quiz

  1. What is the matrix form of this system of equations?
2x+y=5xy=12x + y = 5 \\ x - y = 1

A)

[2111][xy]=[51]\begin{bmatrix} 2 & 1 \\ 1 & -1 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 5 \\ 1 \end{bmatrix}

B) …

C) …

D) …

Correct Answer: A



Correct Answer: B


1. Given the transformation matrix:

M=[2101],v=[12]M = \begin{bmatrix} 2 & 1 \\ 0 & 1 \end{bmatrix}, \quad \vec{v} = \begin{bmatrix} 1 \\ 2 \end{bmatrix}

What is the result of the transformation?

2. What matrix represents the transformation that scales by 33 in xx and 12\frac{1}{2} in yy?

3. If you scale vector (2,3)(2, 3) by a factor of 22 in both xx and yy directions, what is the resulting vector?

4. Which matrix correctly rotates a vector 90°90° counterclockwise?

5. What is the matrix form of this system of equations?

2x+y=5xy=12x + y = 5 \\ x - y = 1
question mark

Given the transformation matrix:

M=[2101],v=[12]M = \begin{bmatrix} 2 & 1 \\ 0 & 1 \end{bmatrix}, \quad \vec{v} = \begin{bmatrix} 1 \\ 2 \end{bmatrix}

What is the result of the transformation?

Select the correct answer

question mark

What matrix represents the transformation that scales by 33 in xx and 12\frac{1}{2} in yy?

Select the correct answer

question mark

If you scale vector (2,3)(2, 3) by a factor of 22 in both xx and yy directions, what is the resulting vector?

Select the correct answer

question mark

Which matrix correctly rotates a vector 90°90° counterclockwise?

Select the correct answer

question mark

What is the matrix form of this system of equations?

2x+y=5xy=12x + y = 5 \\ x - y = 1

Select the correct answer

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 4. Kapittel 5

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

Suggested prompts:

Can you explain how to multiply a matrix by a vector step by step?

What are some other common matrix transformations besides scaling and rotation?

How do you interpret the result of a matrix transformation geometrically?

Awesome!

Completion rate improved to 1.89

bookIntroduction to Matrix Transformations

Sveip for å vise menyen

Matrices allow us to represent and manipulate linear transformations in space. They are core to systems of equations, geometry, and data science workflows.

What Is a Matrix?

A matrix is a rectangular array of numbers used to represent transformations or systems of equations.

A matrix equation can be written as:

Ax=bA \vec{x} = \vec{b}

Where:

  • AA is the coefficient matrix;
  • x\vec{x} is the vector of variables;
  • b\vec{b} is the vector of constants.

Matrix Representation of Linear Systems

Consider the linear system:

2x+y=5xy=12x + y = 5 \\ x - y = 1

This can be rewritten as:

[2111][xy]=[51]\begin{bmatrix} 2 & 1 \\ 1 & -1 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 5 \\ 1 \end{bmatrix}

Matrix Multiplication Breakdown

The multiplication of a matrix with a vector represents a linear combination:

[abcd][xy]=[ax+bycx+dy]=x[ac]+y[bd]\begin{bmatrix} a & b \\ c & d \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} ax + by \\ cx + dy \end{bmatrix} = x \begin{bmatrix} a \\ c \end{bmatrix} + y\begin{bmatrix} b \\ d \end{bmatrix}

Example System in Matrix Form

The system:

3x+2y=74xy=53x + 2y = 7 \\ 4x - y = 5

Can be expressed as:

[3241][xy]=[75]\begin{bmatrix} 3 & 2 \\ 4 & -1 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 7 \\ 5 \end{bmatrix}

Matrices as Transformations

A matrix transforms vectors in space.

For example:

A=[abcd],  v1=[11],  v2=[112]A = \begin{bmatrix} a & b \\ c & d \end{bmatrix},\ \ \vec{v_1} = \begin{bmatrix}1 \\ 1\end{bmatrix},\ \ \vec{v_2} = \begin{bmatrix}1 \\ \frac{1}{2}\end{bmatrix}

This matrix defines how the axes transform under multiplication.

Scaling with Matrices

To apply scaling to a vector use:

S=[sx00sy]S = \begin{bmatrix} s_x & 0 \\ 0 & s_y \end{bmatrix}

Where:

  • sxs_x is the scale factor in the x-direction;
  • sys_y is the scale factor in the y-direction.

Example: Scaling point (2, 3) by 2:

S=[2002],v=[23]S = \begin{bmatrix} 2 & 0 \\ 0 & 2 \end{bmatrix}, \quad \vec{v} = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

Then:

Sv=[46]S \vec{v} = \begin{bmatrix} 4 \\ 6 \end{bmatrix}

Rotation with Matrices

To rotate a vector by angle θ\theta around the origin:

R=[cosθsinθsinθcosθ]R = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}

Example: Rotate (2, 3) by 90°:

R=[cos90ºsin90ºsin90ºcos90º]=[0110],v=[23]R = \begin{bmatrix} \cos90º & -\sin90º \\ \sin90º & \cos90º \end{bmatrix} = \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}, \quad \vec{v} = \begin{bmatrix} 2 \\ 3 \end{bmatrix}

Then:

Rv=[32]R \vec{v} = \begin{bmatrix} -3 \\ 2 \end{bmatrix}

Reflection over the x-axis

Reflection matrix:

M=[1001],M = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix},

Using v=(2,3)\vec{v} = (2, 3):

Mv=[23]M \vec{v} = \begin{bmatrix} 2 \\ -3 \end{bmatrix}

Shearing Transformation (x-direction shear)

Shearing shifts one axis based on the other.

To shear in the x-direction:

M=[1k01]M = \begin{bmatrix} 1 & k \\ 0 & 1 \end{bmatrix}

If k=1.5k = 1.5 and v=(2,3)\vec{v} = (2, 3):

Mv=[6.53]M \vec{v} = \begin{bmatrix} 6.5 \\ 3 \end{bmatrix}

Identity Transformation

The identity matrix performs no transformation:

I=[1001]I = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}

For any vector v\vec{v}:

Iv=vI \vec{v} = \vec{v}

Quiz

  1. What is the matrix form of this system of equations?
2x+y=5xy=12x + y = 5 \\ x - y = 1

A)

[2111][xy]=[51]\begin{bmatrix} 2 & 1 \\ 1 & -1 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 5 \\ 1 \end{bmatrix}

B) …

C) …

D) …

Correct Answer: A



Correct Answer: B


1. Given the transformation matrix:

M=[2101],v=[12]M = \begin{bmatrix} 2 & 1 \\ 0 & 1 \end{bmatrix}, \quad \vec{v} = \begin{bmatrix} 1 \\ 2 \end{bmatrix}

What is the result of the transformation?

2. What matrix represents the transformation that scales by 33 in xx and 12\frac{1}{2} in yy?

3. If you scale vector (2,3)(2, 3) by a factor of 22 in both xx and yy directions, what is the resulting vector?

4. Which matrix correctly rotates a vector 90°90° counterclockwise?

5. What is the matrix form of this system of equations?

2x+y=5xy=12x + y = 5 \\ x - y = 1
question mark

Given the transformation matrix:

M=[2101],v=[12]M = \begin{bmatrix} 2 & 1 \\ 0 & 1 \end{bmatrix}, \quad \vec{v} = \begin{bmatrix} 1 \\ 2 \end{bmatrix}

What is the result of the transformation?

Select the correct answer

question mark

What matrix represents the transformation that scales by 33 in xx and 12\frac{1}{2} in yy?

Select the correct answer

question mark

If you scale vector (2,3)(2, 3) by a factor of 22 in both xx and yy directions, what is the resulting vector?

Select the correct answer

question mark

Which matrix correctly rotates a vector 90°90° counterclockwise?

Select the correct answer

question mark

What is the matrix form of this system of equations?

2x+y=5xy=12x + y = 5 \\ x - y = 1

Select the correct answer

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 4. Kapittel 5
some-alt