mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-13 18:24:28 +02:00
refactor
This commit is contained in:
@@ -17,12 +17,13 @@ include <__private__/__to3d.scad>;
|
|||||||
|
|
||||||
function _q_rotate_p_3d(p, a, v) =
|
function _q_rotate_p_3d(p, a, v) =
|
||||||
let(
|
let(
|
||||||
|
half_a = a / 2,
|
||||||
axis = v / norm(v),
|
axis = v / norm(v),
|
||||||
s = sin(a / 2),
|
s = sin(half_a),
|
||||||
x = s * axis[0],
|
x = s * axis[0],
|
||||||
y = s * axis[1],
|
y = s * axis[1],
|
||||||
z = s * axis[2],
|
z = s * axis[2],
|
||||||
w = cos(a / 2),
|
w = cos(half_a),
|
||||||
|
|
||||||
x2 = x + x,
|
x2 = x + x,
|
||||||
y2 = y + y,
|
y2 = y + y,
|
||||||
|
Reference in New Issue
Block a user