Public
Edited
Oct 3, 2018
4 forks
17 stars
Insert cell
Insert cell
Insert cell
Insert cell
// Given an object in Cartesian coordinates { x: …, y: … }
// compute its Polar coordiantes { r: …, theta: … }
function cartesian_to_polar({x, y}) {
return {
r: Math.sqrt(x * x + y * y),
theta: Math.atan2(y, x)
};
}
Insert cell
Insert cell
// Given an object in Polar coordiantes { r: …, theta: … }
// compute its Cartesian coordinates { x: …, y: … }
function polar_to_cartesian({r, theta}) {
return {
x: r * Math.cos(theta),
y: r * Math.sin(theta)
};
}
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
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

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