Refactored most documentation comments in main math functions.
Rewrite function comments a bit more.
Rewrite some more of the language used in documentation.
Use the variables directly in the distance function.