From 691274cb07a48c672b03eef0a8e05ccc878c9529 Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Sun, 28 Apr 2019 17:50:38 +0800 Subject: [PATCH] refactor --- src/rotate_p.scad | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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,