“눈이 나쁘면 안경을 쓴댔으니 모자란 너에겐 모자를 씌워주마” – 김케장 / 동전주머니엔 동전이 들었지

0014/01/01
math

euclidean algorithm

최대공약수 찾는 방법중 하나

integer factorization

최대공약수, 최소공배수 찾는 방법중 하나

sieve of eratosthenes

소수 찾는 방법

mathematical induction

자연수에 관한 명제 P(n)이 모든 자연수(또는, 어떤 자연수보다 큰 모든 자연수)에 대하여 성립함을 보이는 증명법


\pi

3.14\;159\;265\;358\;979\;323\;238\;462\;643\;383\dotsc

e

2.71\;828\;182\;845\;904\;523\;536\;028\;747\;135\dotsc

fibonacci number

F_0=0,\;F_1=1,\;F_{n+2}=F_{n+1}+F_n

0\;1\;1\;2\;3\;5\;8\;13\;21\;34\;55\;89\;144\dotsc

factorial

0! = 1

1! = 1 * 0! = 1

2! = 2 * 1! = 2

3! = 3 * 2! = 6

4! = 4 * 3! = 24

5! = 5 * 4! = 5 * 4 * 3 * 2 * 1 = 120

exponentiation

a^n = (1 * a \ldots a * a)\; n번만큼 a를 곱

a^0 = 1

a^1 = a

a^b * a^c = a^{b+c}

a^m \div a^n = a^{m-n}

(a^n)^m = a^{nm}

(a^b)^c = (a^c)^b

a^c * b^c = (ab)^c

a^{n+1} = a^n * a

a^{-n} = {\Large{1 \over a^n}}

a^n * a^m = a^{n+m} ∴ a^n * a^{-m} = a^{n+(-m)}

2^1 * 2^{-1} = 2 * {\Large{1 \over 2}} = 1 ∴ a^{1+(-1)} = a^0 = 1 \; (a \ne 0)

({\Large{a \over b}})^{-2} = ({\Large{1 \over{a \over b}^2}}) = ({\Large{b \over a}})^2

8^3 = 2^3 * 4^3

2^n

0 1 / 1 2 / 2 4 / 3 8 / 4 16 / 5 32 / 6 64 / 7 128 / 8 256 / 9 512 / 10 1,024 / 11 2,048 / 12 4,096

13 8,192 / 14 16,384 / 15 32,768 / 16 65,536 / 17 131,072 / 18 262,144 / 19 542,288 / 20 1,048,576

21 2,097,152 / 22 4,194,304 / 23 8,388,608 / 24 16,777,216 / 25 33,554,432 / 26 67,108,864

27 134,217,728 / 28 268,435,456 / 29 536,870,912 / 30 1,073,741,824 / 31 2,147,483,648 / 32 4,294,967,296

8^n

0 1 / 1 8 / 2 64 / 3 512 / 4 4,096 / 5 32,768 / 6 262,144 / 7 2,097,152 / 8 16,777,216 / 9 134,217,728 / 10 1,073,741,824

radian degree

1\;rad = {\Large{180^\circ \over \pi}} \approx 57.2958^\circ

1^\circ = {\Large{\pi \over 180^\circ}} \approx 0.0175\;rad

logarithm

if ( a > 0 && a != 1 && y > 0 ) (y = a^x) == (log_a y = x)


square root

\sqrt{u\cdot u*v\cdot v}=\sqrt{u\cdot u}*\sqrt{v\cdot v}

magnitude(norm)

||u|| = \sqrt{u\cdot u} = \sqrt{u_x*u_x+u_y*u_y}

normalization

\hat{u} = {\Large {u \over ||u||}}

dot product

u \cdot v = u_x v_x + u_y v_y + u_z v_z

\theta= \arccos(\hat{u}\cdot\hat{v})

w\cdot(u\times v)>0.0\text{ ? cw : ccw // } w is an world up vector, left hand coordinate

cos\theta=\hat{u}\cdot\hat{v}={\Large{u\over \sqrt{u\cdot u}}}\cdot{\Large{v\over \sqrt{v\cdot v}}}={\Large{u\over \sqrt{u\cdot u}}}*{\Large{u\over \sqrt{u\cdot u}}}+{\Large{v\over \sqrt{v\cdot v}}}*{\Large{v\over \sqrt{v\cdot v}}}={\Large{u\cdot v\over \sqrt{(u\cdot u)\cdot(v\cdot v)}}}

cross product

u\times v=(u_y v_z-u_z v_y,u_z v_x-u_x v_z,u_x v_y-u_y v_x)

u\times(v+w)=(u\times v)+(u\times w)

v\times 0=0\times v=0

v\times v=0

triple product

u\cdot(v\times w)=v\cdot(u\times w)=w\cdot(u\times v)=det(u,\;v,\;w)

projection

u\cdot v=||u||||v||\cos\theta={\Large{||u||||v||||u_{proj}||\over ||u||}}=||v||||u_{proj}||

||u_{proj}||={\Large{u\cdot v\over ||v||}}

u_{proj}=||u_{proj}||*\hat{v}={\Large{u\cdot v\over ||v||}}*{\Large{v\over ||v||}}={\Large{u\cdot v\over ||v||^2}}*v

u_{proj}=(u\cdot \hat{v})*\hat{v}

matrix multiplication

\begin{bmatrix} A_1 & A_2 \\ A_3 & A_4 \end{bmatrix} * \begin{bmatrix} B_1 & B_2 \\ B_3 & B_4 \end{bmatrix} = \begin{bmatrix} (A_1,A_2) \cdot (B_1,B_3) & (A_1,A_2) \cdot (B_2,B_4) \\ (A_3,A_4) \cdot (B_1,B_3) & (A_3,A_4) \cdot (B_2,B_4) \end{bmatrix}

matrix minor

A = \begin{bmatrix} A_{11} & A_{12} \\ A_{21} & A_{22} \end{bmatrix} \quad \bar{A}_{11} = [ A_{22} ]

determinant

\text{det}A \ne 0 \to this is an invertible matrix

\text{det}A = \displaystyle\sum_{j=1}^{n} A_{1j} (-1)^{1+j} \text{det}\bar{A}_{1j}

\text{det}[A_{11}] = A_{11}

\text{det}\begin{bmatrix} A_{11} & A_{12} \\ A_{21} & A_{22} \end{bmatrix}

= A_{11}\text{det}[A_{22}] - A_{12}\text{det}[A_{21}]

= A_{11}A_{22} - A_{12}A_{21}

\text{det}\begin{bmatrix} A_{11} & A_{12} & A_{13} \\ A_{21} & A_{22} & A_{23} \\ A_{31} & A_{32} & A_{33} \end{bmatrix}

= A_{11}\begin{bmatrix} A_{22} & A_{23} \\ A_{32} & A_{33} \end{bmatrix} - A_{12}\begin{bmatrix} A_{21} & A_{23} \\ A_{31} & A_{33} \end{bmatrix} + A_{13}\begin{bmatrix} A_{21} & A_{22} \\ A_{31} & A_{32} \end{bmatrix}

= A_{11}A_{22}A_{33} + A_{12}A_{23}A_{31} + A_{13}A_{21}A_{32} - A_{13}A_{22}A_{31} - A_{12}A_{21}A_{33} - A_{11}A_{23}A_{32}

A = \begin{bmatrix} 2 & -5 & 3 \\ 1 & 3 & 4 \\ -2 & 3 & 7 \end{bmatrix}

\text{det}A = (2 * 3 * 7) + (-5 * 4 * -2) + (3 * 1 * 3) - (3 * 3 * -2) - (-5 * 1 * 7) - (2 * 4 * 3) = 42+40+9+18+35-24=120

finding determinant by gauss jordan elimination

initial matrix

\begin{bmatrix} (2) & 1 & 3 \\ 4 & 3 & 1 \\ 2 & 4 & 1 \end{bmatrix}

multiply the 1st row by 2

\begin{bmatrix} 4 & 2 & 6 \\ 4 & 3 & 1 \\ 2 & 4 & 1 \end{bmatrix}

subtract the 1st row from the 2nd row and restore 1st row

\begin{bmatrix} (2) & 1 & 3 \\ 0 & (1) & -5 \\ 2 & 4 & 1 \end{bmatrix}

subtract the 1st row from the 3rd row

\begin{bmatrix} (2) & 1 & 3 \\ 0 & (1) & -5 \\ 0 & 3 & -2 \end{bmatrix}

multiply the 2nd row by 3

\begin{bmatrix} (2) & 1 & 3 \\ 0 & 3 & -15 \\ 0 & 3 & -2 \end{bmatrix}

subtract the 2nd row from the 3rd row and restore 2nd row

\begin{bmatrix} (2) & 1 & 3 \\ 0 & (1) & -5 \\ 0 & 0 & (13) \end{bmatrix}

multiply the main diagonal elements

2 * 1 * 13 = 26

cofactor

C_{ij} = (-1)^{i+j}\text{det}\bar{A}_{ij}

cofactor matrix

C_A = \begin{bmatrix} C_{11} & C_{12} & \ldots & C_{1j} \\ C_{21} & C_{22} & \ldots & C_{2j} \\ \vdots & \vdots & \ddots & \vdots \\ C_{i1} & C_{i2} & \ldots & C_{ij} \end{bmatrix}

adjugate matrix

\text{adj}A = {C_A}^T

inverse matrix

A^{-1} = {\Large{\text{adj}A \over \text{det}A}}

scaling matrix

S = \begin{bmatrix} S_x & 0 & 0 \\ 0 & S_y & 0 \\ 0 & 0 & S_z \end{bmatrix} S^{-1} = \begin{bmatrix} {1 \over S_x} & 0 & 0 \\ 0 & {1 \over S_y} & 0 \\ 0 & 0 & {1 \over S_z} \end{bmatrix}

rotation matrix

C = \cos\theta, S = \sin\theta

S = \begin{bmatrix} C + ( 1 - C ) x^2 & ( 1 - c ) xy + Sz & ( 1 - c ) xz - Sy \\ ( 1 - c ) xy - Sz & C + ( 1 - C ) y^2 & ( 1 - c ) yz + Sx \\ ( 1 - c ) xz + Sy & ( 1 - c ) yz - Sx & C + ( 1 - C ) z^2 \end{bmatrix}

R_x = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & C & S & 0 \\ 0 & -S & C & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} R_y = \begin{bmatrix} C & 0 & -S & 0 \\ 0 & 1 & 0 & 0 \\ S & 0 & C & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} R_z = \begin{bmatrix} C & S & 0 & 0 \\ -S & C & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}

translation matrix

T = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ x & y & z & 1 \end{bmatrix} T^{-1} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ -x & -y & -z & 1 \end{bmatrix}

change of basis

U, V, W = \text{new basis}, Q = \text{new origin}

B = \begin{bmatrix} U_x & U_y & U_z & 0 \\ V_x & V_y & V_z & 0 \\ W_x & W_y & W_z & 0 \\ Q_x & Q_y & Q_z & 1 \end{bmatrix}

math의 댓글을 껐습니다 | cat > 사락사락