##
Linear Algebra and Computer Graphics

**Computer Graphics (CG)** are pictures and figures created by using computers.

CG technique has been applied to diverse fields including architecture, video game, and medicine.

Drawing 2D and 3D figures on a computer screen often requires **coordinate transformations**.

This is why linear algebra (especially vectors and matrices) plays very important roles.

## Preparation 1: Projective Geometry

### Euclidean Geometry

coordinates in 2D space are

defined by **x** and **y**

### Projective Geometry

w = 3

w = 1

Extra dimension, **w**, is added.

**projective space**

3D space with w

**homogeneous coordinates**

coordinates in projective space

homogeneous coordinates are

defined by **x**, **y**, and **w**

VS

## Homogeneous Coordinate Transformation

What if I want to apply both rotation and translation at the same time?

## Order Matters!

The order of applying transformations influences the result.

This is because matrix multiplication is **not commutative**.

##
Perspective Projection (3D object projected onto 2D)

We need to convert 3D coordinates to 2D ones to display them on the computer screen.

Computer Graphics (CG) often uses **perspective projection.**

##
Works Cited

Matrices in Computer Graphics

https://sites.math.washington.edu/~king/coursedir/m308a01/Projects/m308a01-pdf/yip.pdf

Explaining Homogeneous Coordinates & Projective Geometry

https://www.tomdalling.com/blog/modern-opengl/explaining-homogenous-coordinates-and-projective-geometry/

コンピュータグラフィックス基礎

http://mitani.cs.tsukuba.ac.jp/lecture/2018/cg_basics/02/02_slides.pdf

OpenGL Tutorial - Tutorial 3

http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/