Public
Edited
Dec 6, 2022
1 fork
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function p(w, th) {
return (t) => [t - cos(w * t) * sin(th), cos(th) * cos(w * t), sin(w * t)];
}
Insert cell
function r(a, b, w, th) {
function R(t) {
let sint = sin(t);
let cost = cos(t);
let sinth = sin(th);
let costh = cos(th);
let coswt = cos(w * t);
let norm = Math.sqrt(a ** 2 * sint ** 2 + b ** 2 * cost ** 2);
let x = (coswt * (a * sinth * sint - b * costh * cost)) / norm + a * cost;
let y = (-coswt * (a * costh * sint + b * sinth * cost)) / norm + b * sint;
let z = sin(w * t);
return [x, y, z];
}
return R;
}
Insert cell
Insert cell
{
let pts = d3
.range(0, 2 * pi, 0.001)
.map(r(5, 3, elliptic_omega_range, elliptic_theta_range))
.map((a) => a.toString().replace(",", " "))
.toString();
d3.select(elliptic_helix)
.select("#path")
.select("coordinate")
.attr("point", pts)
.toString();
}
Insert cell
{
let pts = d3
.range(-5, 5, 0.01)
.map(p(linear_omega_range, linear_theta_range))
.map((a) => a.toString().replace(",", " "))
.toString();
d3.select(linear_helix)
.select("#path")
.select("coordinate")
.attr("point", pts)
.toString();
}
Insert cell
d3.select(circle).select("#path").attr("rotation", `0,0,1,${theta_range}`)
Insert cell
Insert cell
pi = Math.PI
Insert cell
sin = Math.sin
Insert cell
cos = Math.cos
Insert cell
import {
show_x3d,
create_indexedLineSet,
create_sphere
} from "@mcmcclur/plotx3d"
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more