Published
Edited
Dec 15, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
lineIntersectionTest = {
const testCases = [
[{ start: 5, end: 9}, { start: 3, end: 7}],
[{ start: 5, end: 6}, { start: 3, end: 7}],
[{ start: 1, end: 4}, { start: 7, end: 9}],
];
return testCases.map(params => lineIntersection(...params));
}
Insert cell
Insert cell
areaIntersectionTest = {
const a1 = {
top: 0,
bottom: 100,
left: 0,
right: 100,
};
const a2 = {
top: 50,
bottom: 150,
left: 50,
right: 150,
};
const a3 = {
top: 150,
bottom: 250,
left: 150,
right: 250,
};
const testCases = [
[a1, a2],
[a1, a3],
];
return testCases.map(areas => areaIntersection(...areas));
}
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