- Daróczi Gergely honlapja - -

5. hét

Érdekes eredmények:

0.1 + 0.2 == 0.3
0.1 + 0.2 <= 0.3
0.1 + 0.2 >= 0.3
0.1 + 0.2 > 0.3

Újabb bázistranszformáció:

m <- rbind(c(1,1), c(4,4), c(4,1), c(1,4))
plot(m, xlim=c(-10,10), ylim=c(-10,10))
 
b <- rbind(c(2,1), c(1,2))
solve(b, t(m))
points(t(solve(b, t(m))), col="red")
 
b <- rbind(c(-1,1), c(1,1))
solve(b, t(m))
points(t(solve(b, t(m))), col="green")

Függvények egy ábrán:

curve(sin, 0, 10)
curve(cos, add=T, col = "red")

Saját függvény:

f <- function(x) x^2-3*x+6
curve(f, -10, 10)

Gyökök meghatározása:

f <- function(x) x^4+x^3-x^2-3
plot(f, -1, 1)
plot(f, -10, 10)
uniroot(f, c(-10, 10))
uniroot(function(x) x^4+x^3-x^2-3, c(-10, 10))
 
f <- function(x) x^3+8
plot(f, xlim=c(-10,10), ylim=c(-10,10))
plot(f, xlim=c(-5,5), ylim=c(-1,1))
uniroot(f, c(-10, 10))

Deriválás közelítő számítással:

x <- c(1:1000/100, 11:100)
y <- 1/x
plot(x,y, type = 'l')
 
d <- diff(y)/diff(x)
which.max(d)
max(d)
which.min(d)
min(d)