mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-13 18:24:28 +02:00
use vector sub
This commit is contained in:
@@ -24,13 +24,11 @@ module torus_knot_dragon() {
|
|||||||
one_segment(body_r, body_fn, one_body_scale_data);
|
one_segment(body_r, body_fn, one_body_scale_data);
|
||||||
|
|
||||||
function __angy_angz(p1, p2) =
|
function __angy_angz(p1, p2) =
|
||||||
let(
|
let(v = p2 - p1)
|
||||||
dx = p2.x - p1.x,
|
[
|
||||||
dy = p2.y - p1.y,
|
atan2(v.z, norm([v.x, v.y])),
|
||||||
dz = p2.z - p1.z,
|
atan2(v.y, v.x)
|
||||||
ya = atan2(dz, sqrt(dx * dx + dy * dy)),
|
];
|
||||||
za = atan2(dy, dx)
|
|
||||||
) [ya, za];
|
|
||||||
|
|
||||||
h_angy_angz = __angy_angz(d_path[len(d_path) - 2], d_path[len(d_path) - 1]);
|
h_angy_angz = __angy_angz(d_path[len(d_path) - 2], d_path[len(d_path) - 1]);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user