If you do not mind a lot of math, this thread is most likely what you are looking for