Below you will find pages that utilize the taxonomy term “graphics”

Posts

# The Angle Between Two Vectors

Let’s take two vectors \(\vec{a}\) and \(\vec{b}\) on the 2D plane and an orthonormal basis \((\vec{i}, \vec{j})\); we denote \(\mathcal{C}\) the application that maps a vertex to its coordinates. For some \(a, \alpha, b, \beta\) it must be true that:
$$ \mathcal{C}(\vec{a}) = [x_a, y_a] = [a~cos(\alpha), a~sin(\alpha)] \\
\mathcal{C}(\vec{b}) = [x_b, y_b] = [b~cos(\beta), b~sin(\beta)] $$
The sine of the oriented angle Now let us consider the oriented angle between \(\vec{a}\) and \(\vec{b}\); this is equal to \(\beta - \alpha\).

Posts

# The TBN Matrix

Let \(p_1\), \(p_2\) and \(p_3\) be the vertices of a triangle in a 3D space \(S\), with texture coordinates \((u_1, v_1)\), \((u_2, v_2)\) and \((u_3, v_3)\) respectively. Vectors \(\vec{p_1 p_2}\) and \(\vec{p_1 p_3}\) lie in a plane \(P\). Let \((\vec{t}, \vec{b})\) be a base of \(P\). then, there must exist \(\alpha, \beta, \gamma, \delta\) such that:
$$ \vec{p_1 p_2} = \alpha \vec{t} + \beta \vec{b} $$
$$ \vec{p_1 p_3} = \gamma \vec{t} + \delta \vec{b} $$