Can you write this in multiple sub-operations, and document it? Right now I get lost very quickly on what is being done in this calculations.

Use the power operator in python "**" instead of the power function. Makes things more readable.