Dopolni primer kotnih funkcij
This commit is contained in:
parent
a97bee079d
commit
369d60b39a
4 changed files with 92 additions and 8 deletions
|
|
@ -21,18 +21,19 @@ $
|
|||
sin(2alpha) = 2sin(alpha)cos(alpha).
|
||||
$
|
||||
|
||||
Težava je, da formula vsebuje tudi vrednost funkcije $cos(alpha)$. Problem rešimo tako, da hkrati računamo obe funkciji $sin(x)$ in $cos(x)$. Napisali bomo funkcijo sincos(x)
|
||||
Težava je, da formula vsebuje tudi vrednost funkcije $cos(alpha)$. Problem rešimo tako, da hkrati računamo obe funkciji $sin(x)$ in $cos(x)$. Napisali bomo funkcijo `sincos(x)`
|
||||
|
||||
// vstavi signaturo
|
||||
|
||||
Ekvivalent formule /*vstavi referenco!*/ za dvojni kot za $sin$ je
|
||||
Ekvivalent formule /*vstavi referenco!*/ za dvojni kot za $cos$ je
|
||||
|
||||
$
|
||||
cos(2alpha) = cos^2(alpha)-sin^2(alpha)
|
||||
cos(2alpha) = cos^2(alpha)-sin^2(alpha)\
|
||||
cos(x) = cos^2(x/2)-sin^2(x/2)
|
||||
$
|
||||
|
||||
// vstavi tabelo napak
|
||||
#let x_tab = (0.01, 0.05, 0.1, 0.5)
|
||||
/*#let x_tab = (0.01, 0.05, 0.1, 0.5)
|
||||
#let sin_t3(x) = x*(1+x*x*(-(1/6) + x*x/120))
|
||||
#let cos_t3(x) = 1 + x*x*(-1/2 + x*x/24)
|
||||
#let fmt(x) = num(strfmt("{:.2e}", x))
|
||||
|
|
@ -42,3 +43,27 @@ $
|
|||
(x)=>fmt(calc.cos(x)-cos_t3(x)))
|
||||
#set-round(mode: "figures", precision: 3)
|
||||
#table(columns: x_tab.len() + 1, $x$, ..x_tab.map((x)=>str(x)), $sin(x)-T_(sin)(x)$, ..sin_x, $cos(x)-T_(cos)(x)$, ..cos_x)
|
||||
*/
|
||||
|
||||
//vstavi izpis programa
|
||||
#raw(read("sincos.jl"), lang: "jl")
|
||||
|
||||
//končni graf razlike
|
||||
#image("napaka-sinus.svg")
|
||||
|
||||
//diagram
|
||||
|
||||
#import "@preview/fletcher:0.5.8"
|
||||
#import fletcher: diagram, node, edge
|
||||
#import fletcher.shapes: pill, hexagon
|
||||
|
||||
#diagram(node-stroke: 1pt,
|
||||
{
|
||||
node((0, 0), shape: pill)[$sin(x)$]
|
||||
node((1, -1), shape: hexagon)[$cos(x/2)$]
|
||||
node((1, 1), shape: hexagon)[$sin(x/2)$]
|
||||
edge((0, 0), (1, -1), "<-", label-angle: auto)[zmnoži]
|
||||
edge((0, 0), (1, 1), "<-")
|
||||
|
||||
}
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue