# Doppler effect of sound in any general direction and speed

In my high school, I have been taught about doppler effect in sound, in which both source and observer are moving in same line. But I was thinking that what if these bodies were moving in any possible direction, or if these bodies path were some curve, function which was dependent on any set variables. Is there any elegant formula for this? How to derive that formula?

For simplicity, let us assume the observer is at rest, and we will consider two scenarios to see where it comes from. In scenario one, the sound source is moving towards the observer at a speed $$v$$ and emits sound at a frequency $$f$$. Thus between every cycle, the source moves a distance $$v/f$$ and the wavelength gets shortened by this amount to: $$\lambda'=\lambda-v/f=\frac{c-v}{f}$$. The frequency of the sound heard by the observer is thus: $$f'=\frac{c}{\lambda'}=f\frac{c}{c-v}$$ Here $$c$$ is the speed of sound. Now suppose the source is moving directly perpendicular to the observer. In a very small time interval, the distance between the source and the observer is going to be constant and thus the wavelength will not be shifted.
We can now recognize that we can break up any path into two components, one parallel and one perpendicular to the line connecting the observer and the source. We then only have to consider the parallel component of velocity. In general, the doppler effect will be: $$f'=f\frac{c}{c-v_\parallel}$$