I have the function that I want

I have come up with the function that calculates what I want it to.