Public
Edited
Jan 3, 2023
1 star
Insert cell
Insert cell
Spline = [
{ x: 0, y: 0 },
{ x: 1, y: 1 }
]
Insert cell
Insert cell
lerp_colors
Insert cell
Insert cell
Insert cell
pt(t_matrix)
Insert cell
pt(characteristic_matrix)
Insert cell
pt(point_matrix)
Insert cell
pt(basis_function)
Insert cell
t_matrix = math.matrix(_.times(4, (i) => inputs.t ** i))
Insert cell
characteristic_matrix = math.matrix([
[1, 0, 0, 0],
[0, 1, 0, 0],
[-3, -2, 3, -1],
[2, 1, -2, 1]
])
Insert cell
point_matrix = {
const { P0, v0, P1, v1 } = inputs;
return math.matrix([[P0], [v0], [P1], [v1]]);
}
Insert cell
basis_function = math.multiply(t_matrix, characteristic_matrix)
Insert cell
import { Coords } from "@jgrunik/inputs-coords"
Insert cell
math = import("https://cdn.skypack.dev/mathjs@11.5.0")
Insert cell
import { pt } from "@fil/pt"
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more