Platform
Resources
Pricing
Sign in
Get started
Toph Tucker
Workspace
Fork
Public
Sketches
By
Toph Tucker
Edited
Aug 3, 2023
Insert cell
Insert cell
Insert cell
Insert cell
function
factorial
(
x
)
{
return
!
x
?
1
:
x
*
factorial
(
x
-
1
)
;
}
Insert cell
expTerm
=
(
x
,
n
)
=>
(
x
**
n
)
/
factorial
(
n
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function
series
(
term
)
{
return
function
*
(
x
)
{
let
collector
=
0
,
n
=
0
,
t
;
while
(
!
isNaN
(
t
=
term
(
x
,
n
++
)
)
)
{
yield
collector
+=
t
;
if
(
Math
.
abs
(
t
)
<
1e-9
)
break
;
}
}
;
}
Insert cell
exp
=
series
(
expTerm
)
Insert cell
Insert cell
Insert cell
ex
=
exp
(
expX
)
Insert cell
Insert cell
Math
.
exp
(
expX
)
Insert cell
Insert cell
Insert cell
Insert cell
cosTerm
=
(
x
,
n
)
=>
(
n
%
2
?
-
1
:
1
)
*
expTerm
(
x
,
n
*
2
)
Insert cell
cos
=
series
(
cosTerm
)
Insert cell
Insert cell
sinTerm
=
(
x
,
n
)
=>
(
n
%
2
?
-
1
:
1
)
*
expTerm
(
x
,
n
*
2
+
1
)
Insert cell
sin
=
series
(
sinTerm
)
Insert cell
Insert cell
function
*
expI
(
x
)
{
let
_r
=
cos
(
x
)
,
r
;
let
_i
=
sin
(
x
)
,
i
;
while
(
!
(
r
=
_r
.
next
(
)
)
.
done
&&
!
(
i
=
_i
.
next
(
)
)
.
done
)
{
yield
[
r
.
value
,
i
.
value
]
;
}
}
Insert cell
Insert cell
Insert cell
ex2
=
expI
(
expX
)
Insert cell
Insert cell
round
=
(
x
,
place
)
=>
Math
.
round
(
x
*
10
**
place
)
/
10
**
place
Insert cell
formatComplex
=
(
[
r
,
i
]
)
=>
{
r
=
round
(
r
,
6
)
;
i
=
round
(
i
,
6
)
;
return
tex
`
${
r
?
r
:
""
}
${
r
&&
i
?
(
i
>
0
?
"+"
:
"-"
)
:
""
}
${
i
?
`i${
Math
.
abs
(
i
)
!==
1
?
Math
.
abs
(
i
)
:
""
}`
:
""
}`
;
}
Insert cell
formatComplex
(
ex2
)
Insert cell
Insert cell
expI1
=
(
x
)
=>
formatComplex
(
[
Math
.
cos
(
x
)
,
Math
.
sin
(
x
)
]
)
Insert cell
Insert cell
Insert cell
expI1
(
expX
)
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.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
factorial
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
expTerm
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
expX
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
expN
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
series
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
exp
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
ex
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
cosTerm
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
cos
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
sinTerm
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
sin
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
expI
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
ex2
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
round
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
formatComplex
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
expI1
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML