Published
Edited
Oct 2, 2018
Insert cell
Insert cell
polarize = ({ x, y }) => ({
ro: Math.sqrt(x**2 + y**2),
theta: Math.atan2(x, y)
})
Insert cell
cartesize = ({ ro, theta }) => ({
x: ro * Math.cos(theta),
y: ro * Math.sin(theta)
})
Insert cell
inscribe = ({ ro, theta }, roMax) =>
ro <= roMax ? { ro, theta } : { roMax, theta }
Insert cell
outscribe = ({ ro, theta }, roMin) =>
ro >= roMin ? { ro, theta } : { roMin, theta }
Insert cell
translate = ({ x, y }, { deltaX, deltaY }) => ({
x: x + deltaX,
y: y + deltaY
})
Insert cell
scale = ({ x, y }, ratio) => ({
x: ratio * x,
y: ratio * y
})
Insert cell
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