Published
Edited
Jul 18, 2021
1 fork
5 stars
Also listed in…
Math
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
// A parameterization of the Mobius strip
p = (u, v) => [
(1 + (v * Math.cos(u / 2)) / 2) * Math.cos(u),
(1 + (v * Math.cos(u / 2)) / 2) * Math.sin(u),
(v * Math.sin(u / 2)) / 2
]
Insert cell
// The normal vector at the point p(u,v)
N = (u, v) => [
0.25 *
(Math.sin(u / 2) * (-2 * Math.cos(u) + v * Math.sin(u / 2) * Math.sin(u))),
-(
2 * Math.cos(u / 2) -
2 * Math.cos((3 * u) / 2) +
v * (Math.cos(u) + Math.pow(Math.sin(u), 2))
) / 8,
0.25 * (Math.cos(u / 2) * (2 + v * Math.cos(u / 2)))
]
Insert cell
html`
<style>
canvas {
outline: none;
}
</style>
`
Insert cell
Insert cell
import {
show_x3d,
create_sphere,
create_arrow
} from "@mcmcclur/x3dom-primitives"
Insert cell
import { rotation_vector } from "@mcmcclur/x3dom-utilities"
Insert cell
import { create_surface } from "@mcmcclur/parametric-surfaces"
Insert cell
import { Scrubber } from "@mbostock/scrubber"
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