I am curious to know why the orthogonality of two (real) functions $f(x)$, $g(x)$ is given by:
$$\int_{-L}^{L} f(x) \,g(x) \; \text{d}x = 0$$
I see a kind of similarity between this definition and the orthogonality of vectors $\vec{v}$, $\vec{w}$ $\in$ $\mathbb{R}^n$, $\,$ viz. $\vec{v} \cdot \vec{w} = v_i \, w_i = 0$. It even makes sense to me that the domain of integration should play an important role in this result. However, I'm at a loss to imagine
a) the context that would've prompted such an extension;
b) the meaning of orthogonality (i.e. is there any way of thinking of this that is as intuitive as the geometric orthogonality of the vector version, where we can intuitively understand the meaning of orthogonality for vectors in $\mathbb{R}^2$ and $\mathbb{R}^3$ and extend the concept to higher dimensions?).
Perhaps the most concise way of asking my question would be is there an alternative way of viewing the definition of orthogonality of functions that is analogous to the geometric definition of the vector dot product (i.e. $\vec{v} \cdot \vec{w} = |\vec{v}|\, |\vec{w}| \cos\theta$)?
I looked at this question, but it doesn't really get at what I'm after.