Platform
Resources
Pricing
Sign in
Get started
Austin Whittier
Workspace
Fork
Published
By
Austin Whittier
Edited
May 19, 2019
Importers
Insert cell
Insert cell
function
sub
(
a
,
b
)
{
return
{
x
:
a
.
x
-
b
.
x
,
y
:
a
.
y
-
b
.
y
}
;
}
Insert cell
function
add
(
a
,
b
)
{
return
{
x
:
a
.
x
+
b
.
x
,
y
:
a
.
y
+
b
.
y
}
;
}
Insert cell
function
mul
(
a
,
b
)
{
return
{
x
:
a
.
x
*
b
,
y
:
a
.
y
*
b
}
;
}
Insert cell
function
div
(
a
,
b
)
{
return
{
x
:
a
.
x
/
b
,
y
:
a
.
y
/
b
}
;
}
Insert cell
function
midpoint
(
a
,
b
)
{
return
div
(
add
(
a
,
b
)
,
2
)
;
}
Insert cell
function
formatPoint
(
value
)
{
return
`(${
value
.
x
}, ${
value
.
y
})`
;
}
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
sub
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
add
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
mul
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
div
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
midpoint
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
formatPoint
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML