Práctica 3

Transcripción

Práctica 3
Práctica 3
Combinando gráficos
PlotAx3 − SinAx2 E, 8x, −2, 2<, Background → Yellow, PlotStyle → RedE
La instrucción Show
La instrucción Show permite reproducir un gráfico ya existente o visualizar simultáneamente varios
gráficos previamente creados. Mathemática guarda la información de cualquier gráfico realizado, de forma
que puede volverse a utilizar usando esta instrucción.
? Show
Añadiendo opciones
Show[gráfico, opciones]
a = PlotAx3 − SinAx2 E, 8x, −2, 2<, BaseStyle → Blue, PlotStyle → Red, PlotLabel → curvaE
Show[a,AspectRatio→1,Background->LightPink]
Show@%, AxesLabel → 8"dibujo final", None<, Background → LightCyanD
Presentación simultánea de varios gráficos.
Show[{gráfico1,gráfico2,....}, opciones] ó Show[gráfico1,gráfico2,.., opciones]
g1 = Plot@x Cos@xD, 8x, −4, 6<, PlotStyle → RedD
g2 = PlotALogAx2 E, 8x, −1, 1<, PlotStyle → GreenE
g3 = Show[{g1,g2},Frame→True,PlotRange->All]
g4 = Plot[x Sin[x],{x,-10,10},PlotStyle->Blue]
2
practica3.nb
Show[{g3,g4}]
Y si tenemos varios elementos de una familia de gráficas de funciones:
TableBPlotBn Sin@xD, 8x, 0, 2 π <, PlotStyle → RGBColorB
n
n+4
, 0.3, 1 −
n
n+4
FF, 8n, 1, 5<F
Show@%, PlotRange → AllD
Presentación no simultanea de varios gráficos
GraphicsGrid representa una tabla rectangular de objetos gráficos y trabaja como si fuera una matriz
GraphicsGrid[ { { gráfico11, gráfico12,...},{ gráfico21, gráfico22,...},... } , opciones]
GraphicsColumn representa unacolumna de objetos gráficos
GraphicsColumn[ { gráfico1, gráfico2,...} , opciones]
GraphicsRow representa un vector de objetos gráficos
GraphicsRow[{ gráfico1, gráfico2,...} , opciones]
GraphicsGrid[{{g1,g2},{g3,g4}}]
Options@GraphicsGridD
GraphicsGrid@88g1, g2<, 8g3, g4<<, Frame → All, FrameStyle → ThickD
GraphicsColumn@8g1, g2, g3, g4<, Background → 8Red, Blue, Green, Yellow<D
GraphicsRow@8g1, g2, g3, g4<, Frame → True, FrameStyle → Gray, Spacings → [email protected]
practica3.nb
Curiosidad: Animaciones
Mathematica contiene instrucciones que generan una especie de animación a partir de distintos objetos
gráficos.
Animate[ Plot[ f[t][x], {x,a,b},opciones], {t,t1,t2},opciones]
Animate@Plot@Sin@t xD, 8x, 0, 2 π<D, 8t, 1, 5<D
Options@AnimateD
Animate@Plot@Sin@a xD + Sin@b xD, 8x, 0, 2 π<, PlotRange → 8−2, 2<D, 8a, 1, 5<, 8b, 1, 5<D
AnimateAPlotA4 p x2 , 8x, −4, 4<, PlotStyle → Thick, PlotRange → 80, 300<E,
8p, 1, 5<, DefaultDuration → 10E
ListAnimate[Table[ Plot[ f[n][x], {x,a,b}, opciones],{n,n1,n2}],opciones]
ListAnimate@Table@Plot@Sin@n xD, 8x, 0, 2 π<D, 8n, 1, 5<DD
ListAnimate@Table@
PolarPlot@r Sin@θD, 8θ, 0, 2 π<, PlotStyle → Thick, PlotRange → 8−5, 5<D, 8r, 1, 5<DD
Ejercicios
1.- Dibuja varias hipérbolas de centro C(h,k)=? y semiejes a y
b,viendo como varían esas hipérbolas cuando a=1,2,3,4 y b=1,2,3,4
usando la instrucción Show[].
3
4
practica3.nb
2.- Define una familia de gráficas de parábolas en términos del
parámetro p, que sean parábolas de vértice V(h,k)=?, y dibuja varios
elementos de esta familia ( p = 1,2,3,4 ) usando la instrucción:
Show[] y GraphicsGrid[].
Ecuación de la hipérbola de centro C Hh, kL y semiejes a y b :
Ayuda1
Hy − kL2
a2
−
Hx − hL2
b2
=1
b2
=
c2 − a2
a = dist HC, V 1L = dist HC, V 2L
c = dist HC, F 1L = dist HC, F 2L
donde
Las dos funciones de una variable que necesitamos
para conseguir esa hipérbola se obtienen despejando
la variable dependiente y de la ecuación
Hy − kL2
a2
±
=
Hx − hL2
Hx − hL2
b2
b2
y−k
=
a
+1
+1
f 1@xD = k + a
f 2@xD = k − a
y −k = ± a
Hx − hL2
b2
Hx − hL2
b2
Hx − hL2
b2
+1
+1
+1
∞ < x < −∞
practica3.nb
Ecuación de la parábola de vértice V Hh, kL y foco F Hh + p, kL con p > 0 :
Ayuda2
Hy − kL2 = 4 p Hx − hL
Las dos funciones de una variable que necesitamos
para conseguir esa parábola se obtiene despejando
la variable dependiente y de la ecuación
y − k = ± 4 p Hx − hL
f 1@xD = k + 2
f 2@xD = k − 2
p Hx − hL
p Hx − hL
x≥h
5

Documentos relacionados