Error in rotation calculations was caused by failure to convert angle values to radians (as expected by standard library trigonometric functions). Fixed.