Published
Edited
Feb 27, 2022
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
C12 = 0.7853134
Insert cell
C32 = -0.3216147
Insert cell
C52 = 0.0363551
Insert cell
// Apollo’s approx for sin(π/2 y)/2
f = y => {
const y2 = y * y;
return ((C52 * y2 + C32) * y2 + C12) * y;
}
Insert cell
// Taylor series
taylor = y => {
const y2 = y * y;
return ((0.0398463 * y2 - 0.3229820) * y2 + 0.7853981) * y;
}
Insert cell
errorA = y => Math.sin(halfPi * y) / 2 - f(y)
Insert cell
errorT = y => Math.sin(halfPi * y) / 2 - taylor(y)
Insert cell
halfPi = Math.PI / 2
Insert cell
N = 120
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.
Learn more