Platform
Resources
Pricing
Sign in
Get started
Ashwin Reddy
Robot Learning Enthusiast
Workspace
Fork
Published
By
Ashwin Reddy
Edited
Jul 12, 2018
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
class
SimpsonsRule
extends
DefiniteIntegral
{
constructor
(
)
{
super
(
)
;
}
compute
(
f
,
a
,
b
)
{
let
coeff
=
(
b
-
a
)
/
6
;
let
midpoint
=
(
a
+
b
)
/
2
;
return
coeff
*
(
f
(
a
)
+
4
*
f
(
midpoint
)
+
f
(
b
)
)
}
}
Insert cell
(
new
SimpsonsRule
(
)
)
.
compute
(
(
x
)
=>
Math
.
sin
(
x
)
,
0
,
Math
.
PI
)
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
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
SimpsonsRule
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