Skip to content

Commit c439572

Browse files
author
Michael Abbott
committed
002
1 parent 99ddef0 commit c439572

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,20 @@
33
Provides Bhaskara I's sine approximation formula
44

55
```julia
6-
sinπ(θ) = 16-θ)θ / (5π^2 - 4-θ)θ) # < 0.1% error, θ ∈ [0,π]
6+
sinπ(θ) = 16-θ)θ / (5π^2 - 4-θ)θ) # < 0.1% error, θ ∈ [0,π]
77
```
88

99
There is also `sin2π(θ)` for `θ ∈ [-π,π]`, and `Bhaskara.sin(θ)` for `θ ∈ 𝐑`,
1010
by inserting appropriate `mod(,2π)` and `sign()*abs()` bits.
11+
Similarly `cosπ(θ)` is for `θ ∈ [-π/2,π/2]`, and `Bhaskara.cos(θ)` for all `θ ∈ 𝐑`.
1112

12-
Similarly `cosπ(θ)` is for `θ ∈ [-π/2,π/2]`, and `Bhaskara.cos(θ)` for `θ ∈ 𝐑`.
13+
<img src="sin.png?raw=true" width="600" height="400" alt="versions of sin" align="center" padding="5">
14+
15+
<!--
16+
using Bhaskara, Plots
17+
plot(-2π:0.01:2π, sinπ.(-2π:0.01:2π), lab="sin\\pi")
18+
plot!(-2π:0.01:2π, sin2π.(-2π:0.01:2π), lab="sin2\\pi")
19+
plot!(-2π:0.01:2π, Bhaskara.sin.(-2π:0.01:2π), lab="sin")
20+
plot!(xticks=([-2π,-π,0,π,2π],["-2\\pi","-\\pi","0","\\pi","2\\pi"]), ylim=[-2,2])
21+
savefig("sin.png")
22+
-->

sin.png

20.3 KB
Loading

0 commit comments

Comments
 (0)