Is there an equation that solves this kind of problem. Please give full explanation. Thanks!