Published
Edited
Feb 26, 2020
1 star
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
{
function getVelocity(p) {
var l = Math.sqrt(p.x * p.x + p.y * p.y);
return {
x: p.x,
y: p.y
};
}
// function getVelocity(p) {
// var l = Math.sqrt(p.x * p.x + p.y * p.y);
// return {
// x: Math.cos(l),
// y: Math.log(Math.abs(p.x))
// };
// }

const canvas = generateVisual(getVelocity);
const ctx = canvas.getContext('2d')
// ctx.translate(100,100);
// ctx.scale(.25,.25);
addVectorClick(canvas, getVelocity);
return canvas;
}
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