Put arc and line calculation in subroutines
Replaced cross with dot product for angle calc
Fixed calc of ramp down
Added ramp up and down
Fixed pointers in vector functions