angle calculution for rotate should use the jsnums library. This fixes rotation for non-integer angles, but the same problem exists for other primitives (triangle/sas et al))