Refactoring complex math, into more lines.

I am doing this for readability.  I had some lines of code such as
position setting code that was one line of lots of math.  I changed it
to using vectors and multiple lines for readability.  Also added
comments.