When light hits an object, some of it penetrates the object while the rest is reflected.

光は何か物体に当たると一部は中に進んで行き、残りは反射します。

Reflection

反射

When light is reflected, the angle of incidence and the angle of reflection, i.e., $θ_1$ and $θ_2$ in the drawing below, are equal.

光が反射するときには入射角と反射角、つまり下の絵で$θ_1$と$θ_2$が等しくなります。

Screenshot 2023-02-14 at 1.27.14 PM.png

https://codepen.io/kynd/pen/qgjjQj

To express this with vectors, let a vector $\vec{i}$ represent the direction of the original light and $\vec{n}$ represent the direction of the surface of the object (normal). The direction of the reflected light $\vec{r}$ can be expressed by the following equation.

これをベクトルで表現する場合、もとの光の向きをベクトル $\vec{i}$、物体の表面の向き(法線)を$\vec{n}$とすると、反射した光の向き$\vec{r}$ は下記の式で表せます。

${\displaystyle {\begin{aligned}{\vec{r}=\vec{i}-\frac{2\vec{i}\cdot \vec{n}}{\left\|\vec{n}\right\|^2}\vec{n}} \end{aligned}}}$

Let's break it down on a drawing. You can subtract the projection of $\vec{i}$ onto $\vec{n}$ ($\vec{a}$) twice from the original light vector $\vec{i}$ to obtain the reflection vector $\vec{r}$. Because the triangle formed by $\vec{i}$ and $\vec{a}$ is congruent to the triangle formed by $\vec{r}$ and $\vec{a}$, the angle of incidence and the angle of reflection are equal.

図解してみてみましょう。もとの光のベクトル$\vec{i}$から、$\vec{i}$ を $\vec{n}$ に投影したもの($\vec{a}$)を2回引くと反射ベクトル $\vec{r}$が得られます。$\vec{i}$と$\vec{a}$が作る三角形と$\vec{r}$と$\vec{a}$が作る三角形は合同なので入射角と反射角が等しくなります。