diff --git a/src/rotate_p.scad b/src/rotate_p.scad index 0a7f77df..ab8aab65 100644 --- a/src/rotate_p.scad +++ b/src/rotate_p.scad @@ -17,12 +17,13 @@ include <__private__/__to3d.scad>; function _q_rotate_p_3d(p, a, v) = let( + half_a = a / 2, axis = v / norm(v), - s = sin(a / 2), + s = sin(half_a), x = s * axis[0], y = s * axis[1], z = s * axis[2], - w = cos(a / 2), + w = cos(half_a), x2 = x + x, y2 = y + y,