Platform
Resources
Pricing
Sign in
Get started
Abhi Patel
Workspace
Fork
Public
By
Abhi Patel
Edited
Aug 4, 2023
Insert cell
Insert cell
function
calc_time_dilation
(
deltaTdash
,
escape_velocity
)
{
const
light_speed
=
299792458
;
// meters per second
const
time_dilation
=
deltaTdash
*
Math
.
sqrt
(
1
-
(
Math
.
pow
(
escape_velocity
,
2
)
/
Math
.
pow
(
light_speed
,
2
)
)
)
return
time_dilation
}
Insert cell
data
=
{
const
calculations
=
[
]
const
iterations
=
50
for
(
let
i
=
1
;
i
<
iterations
;
i
++
)
{
calculations
.
push
(
{
observer_years
:
i
,
traveller_years
:
calc_time_dilation
(
i
,
200000000
)
}
)
}
return
calculations
}
Insert cell
lki
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
calc_time_dilation
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
data
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML