Public
Edited
Mar 18, 2024
1 star
Insert cell
Insert cell
utils = require("kld-intersections@0.7.0/dist/index-umd.js")
Insert cell
function intersect(ellipseProps, lineProps) {
let { cx, cy, rx, ry } = ellipseProps;
let { x1, x2, y1, y2 } = lineProps;
const ellipse = utils.ShapeInfo.ellipse([cx, cy], rx, ry);
const line = utils.ShapeInfo.line([x1, y1], [x2, y2]);
const intersections = utils.Intersection.intersect(ellipse, line);
return intersections.points[0];
}
Insert cell
Insert cell
Insert cell
c = ({
x: width / 2,
y: height / 2
})
Insert cell
rx = 120
Insert cell
ry = 60
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