Published
Edited
May 19, 2019
Importers
Insert cell
Insert cell
function sub(a, b) {
return {x: a.x - b.x, y: a.y - b.y};
}
Insert cell
function add(a, b) {
return {x: a.x + b.x, y: a.y + b.y};
}
Insert cell
function mul(a, b) {
return {x: a.x * b, y: a.y * b};
}
Insert cell
function div(a, b) {
return {x: a.x / b, y: a.y / b};
}
Insert cell
function midpoint(a,b) {
return div(add(a,b), 2);
}
Insert cell
function formatPoint(value) {
return `(${value.x}, ${value.y})`;
}
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