Você está na página 1de 16

1FormasQuadrticas:representaogrfica,formacannica,cnicas.

> kill(all)$load(draw)$

;; loading \#P"Z:/Users/fsmoreir/maxima/binary/5\_37\_3/sbcl/1\_3\_1/share/draw/grcommon.fasl";; loading \#P"Z:/Use

DefiniodaformaquadraticaassociadamatrizA.

> A:matrix([2,1],[1,3])

2 1
(%o2) ( )
1 3

> X:[x,y]$
fq:expand(X.A.X)
2 2
(%o4) 3 y + 2 x y + 2 x

RepresentaogrficadeumaformaquadrticaR^2R,queumasuperfciedeR^3.

> wxdraw3d(
enhanced3d=true,
explicit(fq,x,1,1,y,2,2)
)$

(%t5)

> wxplot3d(fq,[x,1,1],[y,2,2],[plot_format,gnuplot])$

(%t6)
Vejamosoesboogrficodealgumascurvasdenvelfq=c(elipses)

> wxcontour_plot(fq,[x,4,4],[y,4,4])

(%t7)

(%o7)

Apackagedrawmaisverstil:

> wxdraw3d(
enhanced3d=true,
explicit(fq,x,1,1,y,1,1),
contour_levels={1,1.5,0.5,2},

contour=both
)$

(%t8)
> wxdraw3d(
enhanced3d=true,
colorbox=false,
explicit(fq,x,1,1,y,1,1),
contour_levels={1,1.5,0.5,2},

contour=map
)$

(%t9)

RepresentaogrficadaformaquadrticadeR^2,doplanoz=1edacurvadenvel1,

> wxdraw3d(enhanced3d=true,

explicit(1,x,2,2,y,2,2),

explicit(fq,x,2,2,y,2,2),

contour_levels={1},

contour=surface
)$

(%t10)
> wxdraw3d(enhanced3d=true,
user_preamble="setstylefilltransparentsolid0.6",

explicit(1,x,2,2,y,2,2),

explicit(fq,x,2,2,y,2,2),

contour_levels={1},

contour=surface
)$

(%t11)

> wxdraw3d(enhanced3d=true,proportional_axes=xyz,
user_preamble="setstylefilltransparentsolid0.6",

explicit(1,x,1,1,y,1,1),

explicit(fq,x,1,1,y,1,1),

contour_levels={1},

contour=surface
)$

(%t12)
> wxdraw3d(proportional_axes=xyz,
color=blue,
explicit(1,x,1,1,y,1,1),
color=red,
explicit(fq,x,1,1,y,1,1),

contour_levels={1},

contour=surface
)$

(%t13)

RepresentaogrficaemR^2dacnicafq=1.

> wxdraw2d(
implicit(fq=1,x,2,2,y,2,2),
xaxis=true,
yaxis=true
)$

(%t14)
> wxdraw2d(grid=true,
implicit(fq=1,x,2,2,y,2,2)
)$

(%t15)

ConjugaodeAcomumarotaodengulo%pi/2.

> Rot:matrix([cos(%pi/2),sin(%pi/2)],[sin(%pi/2),cos(%pi/2)])

0 1
(%o16) ( )
1 0

> Rot^^(1)

0 1
(%o17) ( )
1 0

> transpose(Rot)

0 1
(%o18) ( )
1 0

> novaA:Rot.A.transpose(Rot)

3 1
(%o19) ( )
1 2

> novafq:expand(X.novaA.X)

2 2
2 2 + 3
2 2
(%o20) 2 y 2 x y + 3 x

> wxdraw2d(grid=true,proportional_axes=xy,
implicit(fq=1,x,2,2,y,2,2),
color=red,
implicit(novafq=1,x,2,2,y,2,2)
)$

(%t21)

OspontosdeR^2quesatisfazemnovafq=1soostranformadosporRotdoconjuntodospontosquesatisfazemfq=1.

> X1:[x1,y1]
R1:(Rot^^(1)).X1

(%o22) [x1, y1]

y1
(%o23) ( )
x1

> p1:subst([x=R1[1,1],y=R1[2,1]],fq)
novafq1:subst([x1=x,y1=y],p1)

2 2
(%o24) 2 y1 2 x1 y1 + 3 x1

2 2
(%o25) 2 y 2 x y + 3 x

> wxdraw2d(
proportional_axes=xy,
implicit(fq=1,x,1,1,y,1,1),
color=red,
implicit(novafq1=1,x,1,1,y,1,1)
)$

(%t26)
Comoreferido,temosnovafq=novafq1

> Rot:matrix([cos(%pi/10),sin(%pi/10)],[sin(%pi/10),cos(%pi/10)])


cos ( ) sin ( )
10 10
(%o27) ( )

sin ( ) cos ( )
10 10

> Rot^^(1)


cos( ) sin( )
10 10
2 2 2 2
sin(

) +cos(

) sin(

) +cos(

)

10 10 10 10
(%o28)
sin(

) cos(

)
10 10

2 2 2 2
sin(

) +cos(

) sin(

) +cos(

)

10 10 10 10

> trigsimp(%)


cos ( ) sin ( )
10 10
(%o29) ( )

sin ( ) cos ( )
10 10

> transpose(Rot)


cos ( ) sin ( )
10 10
(%o30) ( )

sin ( ) cos ( )
10 10

> novaA:Rot.A.transpose(Rot)


cos ( ) (2 cos ( ) sin ( )) (cos ( ) 3 sin ( )) sin ( ) cos ( ) (2 sin ( ) + cos ( ))
10 10 10 10 10 10 10 10 10
(%o31) (

(2 cos ( ) sin ( )) sin ( ) + cos ( ) (cos ( ) 3 sin ( )) sin ( ) (2 sin ( ) + cos ( )) +
10 10 10 10 10 10 10 10 10

> novafq:expand(X.novaA.X)

2 2 2
2
2
2

(%o32) 2 sin ( ) y + 2 cos ( ) sin ( ) y + 3 cos ( ) y 2 sin ( ) x y 2 cos ( ) sin (
10 10 10 10 10 10

> wxdraw2d(grid=true,proportional_axes=xy,
implicit(fq=1,x,2,2,y,2,2),
color=red,
implicit(novafq=1,x,2,2,y,2,2)
)$

(%t33)
> X1:[x1,y1]
R1:(Rot^^(1)).X1

(%o34) [x1, y1]


sin( )y1 cos( )x1
10 10
2 2
+ 2 2
sin(

) +cos(

) sin(

) +cos(

)

10 10 10 10
(%o35)
cos(

)y1 sin(

)x1
10 10

2 2
2 2
sin(

) +cos(

) sin(

) +cos(

)

10 10 10 10

> p1:subst([x=R1[1,1],y=R1[2,1]],fq)
novafq1:subst([x1=x,y1=y],p1)

2 2

sin ( ) y1 cos ( ) x1 cos ( ) y1 sin ( ) x1
10 10 10 10
(%o36) 2 ( + ) + 3 ( )
2 2 2 2 2 2 2 2

sin ( ) + cos ( ) sin ( ) + cos ( ) sin ( ) + cos ( ) sin ( ) + cos ( )
10 10 10 10 10 10 10 10

2 2

sin ( ) y cos ( ) x cos ( ) y sin ( ) x
10 10 10 10
(%o37) 2 ( + ) + 3 ( )
2 2 2 2 2 2 2 2

sin ( ) + cos ( ) sin ( ) + cos ( ) sin ( ) + cos ( ) sin ( ) + cos ( )
10 10 10 10 10 10 10 10

> wxdraw2d(grid=true,proportional_axes=xy,
implicit(fq=1,x,2,2,y,2,2),
color=red,
implicit(novafq=1,x,2,2,y,2,2)
)$

(%t38)

Estascnicasnoestocentradasnoseixoscoordenados.
CalculodosvaloresprpriosevectoresprpriosdeA.

> eigenvalues(A)
eigenvectors(A)

5 5 5 + 5
(%o39) [[ , ], [1, 1]]
2 2

5 5 5 + 5 5 1 5 + 1
(%o40) [[[ , ], [1, 1]], [[[1, ]], [[1, ]]]]
2 2 2 2

> E:eigenvalues(A)
float(E[1])

5 5 5 + 5
(%o41) [[ , ], [1, 1]]
2 2

(%o42) [1.381966011250105, 3.618033988749895]

> vp1:float(E[1][1])
vp2:float(E[1][2])

(%o43) 1.381966011250105

(%o44) 3.618033988749895

> V:eigenvectors(A)

w1:V[2][1][1]
w2:V[2][2][1]

5 5 5 + 5 5 1 5 + 1
(%o45) [[[ , ], [1, 1]], [[[1, ]], [[1, ]]]]
2 2 2 2

5 1
(%o46) [1, ]
2

5 + 1
(%o47) [1, ]
2

ComoAumamatrizsimtricaosv.p.sonmerosreaiseosvectoresprprios.soortogonais,ouseja,oseuprodutointerno
nulo.Comoambososvaloresprpriossopositivos,ascnicasdestaf.q.soelipses.

> expand(w1.w2)

(%o48) 0

Asdirecesortogonais(dp1edp2)acadavectorprpriopodemobtersedaseguintemaneira.

> dp1:w1.X
dp2:w2.X

(5 1) y
(%o49) x
2

(5 + 1) y
(%o50) + x
2

Representaodacnicaedasdirecesdosvectoresprprios,quesooseixosdamesma.

> wxdraw2d(grid=true,
color=black,
implicit(fq=1,x,1,1,y,1,1),
color=blue,
implicit(dp1=0,x,1,1,y,1,1),
color=red,

implicit(dp2=0,x,1,1,y,1,1)
)$

rat: replaced 2.23606797749979 by 16692641/7465176 = 2.236067977499794rat: replaced 2.23606797749979 by 16692641/74651

(%t51)

Acnicanoestcentradanoseixoscoordenados.

FaamosaconjugaodamatrizAcomamatrizderotaocujascolunassoosvectoresprpriosdeA.Poroutraspalavras,
vamosdiagonalizarconvenientementeamatrizA,calcularamatrizdiagonalquesemelhanteaela,ecujoselementosdiagonais
soosvaloresprpriosdeA.

> MR:transpose(matrix(w1,w2))

1 1
(%o52) ( )
51 5+1

2 2

> invert(MR)

5+1 1

5+1 51 5+1 51
2( + ) +
2 2 2 2

(%o53)
51 1
5+1 51 5+1 51
2( + ) +

2 2 2 2

> ratsimp(%)

5+1 1

25 5
(%o54)
51 1

25 5

> NA:invert(MR).A.MRratsimp(NA)float(%)
51 5+1
3( 51) 3( 5+1)
(2 )(5+1) 1 (5+1)( +2) +1
2
2
2
2

5+1 51 5+1 51 5+1 51 5+1 51
2( + ) + 2( + ) +
2 2 2 2 2 2 2 2

(%o55)
(2
51
)(51)
3( 51)
(51)(
5+1
+2)
3( 5+1)
2
1 2
+1
2 2
+ +
2(
5+1
+
51
)
5+1
+
51
2(
5+1
+
51
)
5+1
+
51

2 2 2 2 2 2 2 2

5 2 5
0
25
(%o56)
3
5 2 +5
0
25

( )
1.381966011250106 0.0
(%o57) ( )
0.0 3.618033988749896

Comovemos,estamatrizdiagonal,enadiagonalfiguramosvaloresprpriosdeA,quenestecasosopositivos.Nestecasoa
formaquadrticafq=1correspondeaumaelipse.

Aformacannicadaformaquadrtica(fqc),

> fqc:ratsimp([x,y].NA.[x,y])

2 2
(5 + 5) y + (5 5) x
(%o58)
2

Representaodacnicafqc=1

> wxdraw2d(grid=true,proportional_axes=xy,
color=black,
implicit(fqc=1,x,1,1,y,1,1)
)$

rat: replaced 2.23606797749979 by 16692641/7465176 = 2.236067977499794

(%t59)

Oseixosdaelipsefqc=1jsooseixoscoordenados.fqc=1

0.1Hiperbole

> kill(all)

(%o0) done

DefiniodaformaquadraticaassociadaamatrizA.

> A:matrix([1,3],[3,3])

1 3
(%o1) ( )
3 3

> X:[x,y]$
fq:expand(X.A.X)
2 2
(%o3) 3 y + 6 x y + x

RepresentaogrficadaformaquadrticadeR^2,queumasuperfciedeR^3,edascnicascorrespondentesaosvalores1,0e
1.

> wxdraw3d(
enhanced3d=true,
explicit(fq,x,3,3,y,3,3),
contour_levels={1,0,1},
contour=both
)$

(%t4)

RepresentaogrficaemR^2dascnicasfq=1,fq=1efq=0.

> wxdraw2d(grid=true,
color=green,
implicit(fq=1,x,2,2,y,2,2),
color=magenta,
implicit(fq=1,x,2,2,y,2,2),
color=blue,
implicit(fq=0,x,2,2,y,2,2)
)$

(%t5)

CalculodosvaloresprpriosevectoresprpriosdeA.

> E:eigenvalues(A)
float(E[1])

(%o6) [[13 1, 13 1], [1, 1]]

[4.60555127546399, 2.605551275463989]
(%o7) [4.60555127546399, 2.605551275463989]

> V:eigenvectors(A)
w1:V[2][1][1]
w2:V[2][2][1]

13 + 2 13 2
(%o8) [[[13 1, 13 1], [1, 1]], [[[1, ]], [[1, ]]]]
3 3


13 + 2
(%o9) [1, ]
3


13 2
(%o10) [1, ]
3

Comoumdosvaloresprpriospositivoeooutronegativo,ascnicasdestaf.q.sohiperboles,conformejtinhamosvistona
representaogrfica.

Asdirecesortogonaisacadavectorprpriopodemobtersedaseguintemaneira.

> dp1:w1.X
dp2:w2.X

(13 + 2) y
(%o11) x
3


(13 2) y
(%o12) + x
3

Representaodascnicasfq=1,fq=0efq=1edasdirecesdosvectoresprprios.

> wxdraw2d(grid=true,
color=black,
implicit(fq=1,x,1,1,y,1,1),
color=blue,
implicit(dp1=0,x,1,1,y,1,1),
color=red,
implicit(dp2=0,x,1,1,y,1,1),
color=green,
implicit(fq=0,x,1,1,y,1,1),
color=magenta,
implicit(fq=1,x,1,1,y,1,1)
)$

rat: replaced 3.605551275463989 by 30349818/8417525 = 3.605551275463987rat: replaced 3.605551275463989 by 30349818/841

(%t13)
Asdirecesdosvectoresprpriossooseixosdascnicas.

Estascnicasnoestocentradasnoseixoscoordenados.Hquecomporaformaquadrticacomumamatrizderotao,cuja
inversacorrespondematrizdosvectoresprpriosnormalizados

Vamosnormalizarosvectoresprprios.

> /*blocoquecalculaanormaeuclidianadeumvector*/
norm(vec):=sqrt(vec.vec)

(%o14) norm (vec) := vec.vec

> w1n:w1/norm(w1)float(norm(w1n))
w2n:w2/norm(w2)float(norm(w2n))

1 13 + 2
(%o15) [ , ]

2 2
(13 +2) (13 +2)
+ 1 3 + 1
9 9

(%o16) 0.9999999999999999


1 13 2
(%o17) [ , ]

2 2
(13 2) (13 2)
+ 1 3 + 1
9 9

(%o18) 1.0

Vamosdefiniramatrizcujascolunassoosvectoresprpriosnormalizados(MRN).estaamatrizderotaoquepermite
diagonalizaramatrizquerepresentaaformaquadrtica,demaneiraafiguraremosvaloresprpriosnadiagonal(NAN).Obtemos,
assim,aformacannicadaformaquadrtica.

> MRN:transpose(matrix(w1n,w2n))float(%)

1 1
2 2

( 13+2) ( 132)
+1 +1
9 9
(%o19)
13 +2 13 2

2 2
( 13+2) ( 132)
3 +1 3 +1
9 9

0.4718579255320244 0.8816745987679439
(%o20) ( )
0.8816745987679439 0.4718579255320243

> NAN:ratsimp(transpose(MRN).A.MRN)float(%)

2113 +69
0
413 +17
(%o21)
2113 69
0
413 17

4.605551275463989 0.0
(%o22) ( )
0.0 2.605551275463985

NocasodeMRNserconstitudaporvetoresnormalizadostemosquetranspose(MRN)=MRN^(1)

Formaquadrticanaformacannica.

> fqcan:ratsimp([x,y].NAN.[x,y])
2 2
(%o23) (13 1) y + (13 1) x

Agora,ascnicasjestocentradasnoseixoscoordenados.

> wxdraw2d(grid=true,
color=green,

implicit(fqcan=1,x,2,2,y,2,2),
color=magenta,

implicit(fqcan=1,x,2,2,y,2,2),
color=blue,

implicit(fqcan=0,x,2,2,y,2,2)
)$

rat: replaced 3.605551275463989 by 30349818/8417525 = 3.605551275463987rat: replaced 3.605551275463989 by 30349818/841

(%t24)

> wxdraw2d(grid=true,proportional_axes=xy,
color=green,
implicit(fqcan=1,x,2,2,y,2,2),
color=magenta,
implicit(fqcan=1,x,2,2,y,2,2),
color=blue,
implicit(fqcan=0,x,2,2,y,2,2)
)$

rat: replaced 3.605551275463989 by 30349818/8417525 = 3.605551275463987rat: replaced 3.605551275463989 by 30349818/841

(%t25)

CreatedwithwxMaxima.

Você também pode gostar