Dodaj tabelo napak
This commit is contained in:
parent
c20e72c395
commit
a97bee079d
4 changed files with 91 additions and 3 deletions
15
sincos.jl
15
sincos.jl
|
|
@ -1,3 +1,14 @@
|
|||
using Plots
|
||||
"""
|
||||
s, c = sincos(x)
|
||||
|
||||
plot(x->sin(x)-(x-x^3/3))
|
||||
Izračunaj vrednost funkcij `sin` in `cos` za dano vrednost `x`.
|
||||
"""
|
||||
function sincos(x)
|
||||
if (abs(x)< 0.05)
|
||||
x2 = x^2
|
||||
return x*(1 + x2*(-1/6 + x2/120)), 1 + x2*(-0.5 + x2/24)
|
||||
end
|
||||
x = mod(x, 2pi)
|
||||
s, c = sincos(x/2)
|
||||
return 2*s*c, c^2 - s^2
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue