-
Notifications
You must be signed in to change notification settings - Fork 2
/
7-asintotas-en-R.R
96 lines (84 loc) · 2.73 KB
/
7-asintotas-en-R.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# UNIVERSIDAD NACIONAL AUTÓNOMA DE MÉXICO
# Facultad de Economía
# Matemáticas I 2021-1
# Profesor: Cesar Hernández
# PRÁCTICA 7: ASÍNTOTAS EN R
library("dplyr")
library("ggplot2")
library("gganimate")
library("png")
x<-seq(-1.5, 1.5, 0.1)
x
fx<-(x^2)+3
gx<-(x^2)+1
fentregx<-fx/gx
fentregx
dfx<-data.frame(x,fx,gx,fentregx)
plot(x,fx,type = "o")
plot(x,gx,type = "o")
plot(x,fentregx,type = "o")
mx<-ggplot() +
geom_polygon(data = dfx, aes(x = x, y = fx), fill = "blue") +
xlab("x") +
ylab("y")
print(mx)
mx<-ggplot() +
geom_polygon(data = dfx, aes(x = x, y = fx), fill = "blue") +
geom_polygon( data = dfx, aes(x = x, y = gx), fill= "red") +
xlab("x") +
ylab("y")
print(mx)
nx<-ggplot() +
geom_polygon( data = dfx, aes(x = x, y = fentregx), fill= "green") +
geom_line(data = dfx, aes(x = x, y = fx), color = "blue") +
geom_line(data = dfx, aes(x = x, y = gx), color = "red") +
xlab("x") +
ylab("y")
print(nx)
ox<-ggplot() +
geom_line( data = dfx, aes(x = x, y = fentregx), color= "green") +
geom_line(data = dfx, aes(x = x, y = fx), color = "blue") +
geom_line(data = dfx, aes(x = x, y = gx), color = "red") +
xlab("x") +
ylab("y") +
geom_vline(xintercept = -1)
print(ox)
px<-ggplot() +
geom_line( data = dfx, aes(x = x, y = fentregx), color= "green") +
geom_line(data = dfx, aes(x = x, y = fx), color = "blue") +
geom_line(data = dfx, aes(x = x, y = gx), color = "red") +
xlab("x") +
ylab("y") +
geom_vline(xintercept = -1) +
geom_vline(xintercept = 1)
print(px)
qx<-ggplot() + geom_line( data = dfx, aes(x = x, y = fentregx), color = "green") +
geom_line(data = dfx, aes(x = x, y = fx), color = "blue") +
geom_line(data = dfx, aes(x = x, y = gx), color = "red") +
xlab("x") +
ylab("y") +
geom_vline(xintercept = -1) +
geom_vline(xintercept = 1) +
geom_hline(yintercept = 2)
print(qx)
rx<-ggplot() + geom_line( data = dfx, aes(x = x, y = fentregx), color = "green") +
geom_line(data = dfx, aes(x = x, y = fx), color = "blue") +
geom_line(data = dfx, aes(x = x, y = gx), color = "red") +
xlab("x") +
ylab("y") +
geom_vline(xintercept = -1) +
geom_vline(xintercept = 1) +
geom_hline(yintercept = 2) +
geom_abline(intercept = 3)
print(rx)
sx<-ggplot() + geom_line( data = dfx, aes(x = x, y = fentregx), color = "green") +
geom_line(data = dfx, aes(x = x, y = fx), color = "blue") +
geom_line(data = dfx, aes(x = x, y = gx), color = "red") +
xlab("x") +
ylab("y") +
geom_vline(xintercept = -1) +
geom_vline(xintercept = 1) +
geom_hline(yintercept = 2) +
geom_abline(intercept = 3) +
geom_abline(intercept = 3,slope = 3,color="yellow")
print(sx)