Platform
Resources
Pricing
Sign in
Get started
Migsar
Doing software. Interested in Meetups and local knowledge transfer. Strong opinions on what making a better world means, feel free to ask.
Workspace
Fork
Published
By
Migsar
Edited
Dec 15, 2020
Insert cell
Insert cell
Insert cell
Insert cell
1
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.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
lineIntersectionText
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
areaIntersectionText
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
lineIntersection
Edit
Show 1 comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
lineIntersectionTest
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
areaIntersection
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
areaIntersectionTest
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML