setup variables for angle calculation