---
# System prepended metadata

title: Matrix and Geometry
tags: [math, geometry]

---

{%hackmd @RintarouTW/About %}

# Matrix and Geometry 

## Dot Product

$$
\pmatrix{a&b}\pmatrix{x\\y}\iff\pmatrix{ax+by}\iff\pmatrix{x&y}\pmatrix{a\\b}\\
\pmatrix{c&d}\pmatrix{x\\y}\iff\pmatrix{cx+dy}\iff\pmatrix{x&y}\pmatrix{c\\d}\\
\Downarrow\\
\pmatrix{a&b\\c&d}\pmatrix{x\\y}=\pmatrix{ax+by\\cx+dy}\\
\Updownarrow\\
\pmatrix{x&y}\pmatrix{a&c\\b&d}=\pmatrix{ax+by&cx+dy}\\
$$

## Translation

$$
\pmatrix{x\\y}+\pmatrix{tx\\ty} = \pmatrix{x+tx\\y+ty}
\\\Updownarrow\\
\pmatrix{x&y}+\pmatrix{tx&ty} = \pmatrix{x+tx&y+ty}
$$

## Reflection(Mirror)


### $x$ axis

$$
\pmatrix{x\\y}\overset{f}{\implies}\pmatrix{x\\-y}\iff f\pmatrix{x\\y}=\pmatrix{1&0\\0&-1}\pmatrix{x\\y}\\
\Updownarrow\\
\pmatrix{x&y}\overset{f}{\implies}\pmatrix{x&-y}\iff f\pmatrix{x&y}=\pmatrix{x&y}\pmatrix{1&0\\0&-1}
$$

### $y$ axis

$$
\pmatrix{x\\y}\overset{f}{\implies}\pmatrix{-x\\y}\iff f\pmatrix{x\\y}=\pmatrix{-1&0\\0&1}\pmatrix{x\\y}\\
\Updownarrow\\
\pmatrix{x&y}\overset{f}{\implies}\pmatrix{-x&y}\iff f\pmatrix{x&y}=\pmatrix{x&y}\pmatrix{-1&0\\0&1}
$$

### $y = x$

$$
\pmatrix{x\\y}\overset{f}{\implies}\pmatrix{y\\x}\iff f\pmatrix{x\\y} = \pmatrix{0&1\\1&0}\pmatrix{x\\y}\\
\Updownarrow\\
\pmatrix{x&y}\overset{f}{\implies}\pmatrix{y&x}\iff f\pmatrix{x&y}=\pmatrix{x&y} \pmatrix{0&1\\1&0}
$$

### $y = -x$

$$
\pmatrix{x\\y}\overset{f}{\implies}\pmatrix{-y\\-x}\iff f\pmatrix{x\\y} = \pmatrix{0&-1\\-1&0}\pmatrix{x\\y}\\
\Updownarrow\\
\pmatrix{x&y}\overset{f}{\implies}\pmatrix{y&x}\iff f\pmatrix{x&y}=\pmatrix{x&y} \pmatrix{0&-1\\-1&0}
$$

## Rotation

### Rotate $90^{\circ}$

$$
\pmatrix{x\\y}\overset{f}{\implies}\pmatrix{y\\x}\overset{g}\implies\pmatrix{-y\\x}\\
\Downarrow\\
rotate90^\circ=g(f\pmatrix{x\\y})\iff g(f\pmatrix{x&y})\\
where\cases{
f=\pmatrix{0&1\\1&0}\\
g=\pmatrix{-1&0\\0&1}
}\\
\Downarrow\\
\cases{
rotate90^\circ\pmatrix{x\\y}=g\circ f\pmatrix{x\\y}=\pmatrix{-1&0\\0&1}\pmatrix{0&1\\1&0}\pmatrix{x\\y}=\pmatrix{0&-1\\1&0}\pmatrix{x\\y}\\
rotate90^\circ\pmatrix{x&y}=g\circ f\pmatrix{x&y}=\pmatrix{x&y}\pmatrix{0&1\\1&0}\pmatrix{-1&0\\0&1}=\pmatrix{x&y}\pmatrix{0&1\\-1&0}\\
}
$$

### Rotate $-90^{\circ}$

$$
\pmatrix{x\\y}\overset{f}{\implies}\pmatrix{y\\x}\overset{g}\implies\pmatrix{y\\-x}\\
\Downarrow\\
rotate90=g(f\pmatrix{x\\y})\iff g(f\pmatrix{x&y})\\
where\cases{
f=\pmatrix{0&1\\1&0}\\
g=\pmatrix{1&0\\0&-1}
}\\
\Downarrow\\
\cases{
rotate-90^\circ\pmatrix{x\\y}=g\circ f\pmatrix{x\\y}=\pmatrix{1&0\\0&-1}\pmatrix{0&1\\1&0}\pmatrix{x\\y}=\pmatrix{0&1\\-1&0}\pmatrix{x\\y}\\
rotate-90^\circ\pmatrix{x&y}=g\circ f\pmatrix{x&y}=\pmatrix{x&y}\pmatrix{0&1\\1&0}\pmatrix{1&0\\0&-1}=\pmatrix{x&y}\pmatrix{0&-1\\1&0}\\
}
$$

### Rotate$\theta$

$$
\pmatrix{\cos\theta x-\sin\theta y\\\sin\theta x+\cos\theta y}\implies
\pmatrix{\cos\theta&-\sin\theta\\\sin\theta&\cos\theta}\pmatrix{x\\y}
$$

###### tags: `math` `geometry`