# Angle between functions

I have a rather simple question but googling it did not bring a satisfactory result:

Assume you have given two function $f$ and $g$ on some space $\mathcal{L}^2(\Omega)$ where $\Omega \subset \mathbb{R}^n$. I am looking for the angle between the functions.

Is $~\cos(\alpha) = \dfrac{\langle f, g\rangle}{\|f\|\|g\|}~$ already the formula I am looking for? I know that this is the formula for the angle between subspaces. If I assume I look at the two subspaces $\operatorname{span}(f)$ and $\operatorname{span}(g)$ than all should work out...

Thanks for help!

-
Yes, that's the formula you're looking for. – Qiaochu Yuan Feb 20 '12 at 20:02
I changed "<" and ">" to "\langle" and "\rangle", and "cos" to "\cos". Standard TeX usage. – Michael Hardy Feb 20 '12 at 20:05
Thanks to both of you:) – MasterP Feb 20 '12 at 20:08

Since you have two vectors in any vector space (over $\mathbb{R}$), you consider only the plane generated by theses both vectors this plane is isometric to $\mathbb{R}^2$ then you can use without any loss of generality the same approach used in the plane, Gram-Schmidt whatever.