What does it mean when two functions are "orthogonal", why is it important? I have often come across the concept of orthogonality and orthogonal functions e.g in fourier series the basis functions are cos and sine, and they are orthogonal. For vectors being orthogonal means that they are actually perpendicular such that their dot product is zero. However, I am not sure how sine and cosine are actually orthogonal. They are 90 out of phase, but there must be a different reason why they are considered orthogonal. What is that reason? Does being orthognal really have something to do with geometry i.e 90 degree angels?
Why do we want to have orthogonal things so often in maths? especially with transforms like fourier transform, we want to have orthogonal basis. What does that even mean? Is there something magical about things being orthogonal?

simply in quantum mechanics the orthogonal functions equal to zero means that no overlap between them. each function represents the energy state and for non degeneracy states the overlap between states is not found. in vector form means that  no projection of each vector on other vector like the unit vector i, j, k are the basis vectors.
