vetores (cont) e matrizes
DESCRIPTION
Matrizes e transformações lineares (Rotação)Grupo de Estudo em Ambientes Virtuais (geav.ecomp.poli.br)TRANSCRIPT
![Page 1: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/1.jpg)
Vetores (cont), Matrizes e Transformações Lineares
Anderson [email protected]
Grupo de Estudo em Ambientes Virtuaisgeav.ecomp.poli.br
![Page 2: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/2.jpg)
Definição Matemática
• NotaçõesExemplo de Matriz Índices (linha e coluna)
Diagonal Principal Matriz Diagonal Matriz Identidade
![Page 3: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/3.jpg)
Definição Matemática
• Vetores como Matrizes
Vetor Coluna (n x 1)Vetor Linha (1 x n)
Matriz Transposta Matriz Transposta
![Page 4: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/4.jpg)
Definição Matemática
• Vetores como MatrizesTransposta de vetor linha Transposta de vetor coluna
![Page 5: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/5.jpg)
Definição Matemática
• Multiplicar matriz por escalar
![Page 6: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/6.jpg)
Definição Matemática
• Produto de Matrizes
linhas do resultado
colunas do resultadoDevem ser
iguais
Cada termo é o produto escalar do vetor linha i com o vetor coluna j
![Page 7: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/7.jpg)
Definição Matemática
• Produto de Matrizes
Outra maneira de reescrever as matrizes
![Page 8: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/8.jpg)
Definição Matemática
• Exemplo
![Page 9: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/9.jpg)
Definição Matemática
• Exemplo
![Page 10: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/10.jpg)
Definição Matemática
• Obs: Matriz M x Matriz quadrada S– I,j x j,j = l,j– l,l x l,j = l,j– M x I = I x M = M (I = Matriz Identidade)– AB ≠ BA (Não é comutativa)– (AB)C = A(BC) (É associativa)– (kA)B = k(AB) = A(kB)– (vA)B = v(AB)– (AB)T = BTAT
![Page 11: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/11.jpg)
Definição Matemática
Indefinido
Indefinido
![Page 12: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/12.jpg)
Definição Matemática
• Vantagens (Vetores Linhas)– Mais fácil escrever [4,5,6] do que – Leitura Natural– DirectX usa
• Vantagens (Vetores Coluna)– Equações (Ex: ABCv parece A(B(C(v))))– Livros de álgebra linear adotam– Livros de Computação Gráfica adotam– OpenGL usa
![Page 13: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/13.jpg)
Interpretação Geométrica
• Descreve uma transformação linear• Pode “esticar”, porém não pode curvar ou
distorcer o espaço• Rotação• Escala• Projeção Ortográfica• Reflexão• Shearing (Skewing)
![Page 14: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/14.jpg)
Interpretação Geométrica
• Como uma matriz transforma vetores
![Page 15: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/15.jpg)
Interpretação Geométrica
• O que uma matriz parece?
Cada linha da matriz pode ser vista como vetor base após a transformação
![Page 16: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/16.jpg)
Interpretação Geométrica
• Implicações– Podemos ver uma matriz e visualizar que
transformação ela faz.– Podemos fazer uma transformação reversa
• Um exemplo:
![Page 17: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/17.jpg)
Interpretação Geométrica
![Page 18: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/18.jpg)
Interpretação Geométrica
• Para facilitar
![Page 19: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/19.jpg)
Interpretação Geométrica
• Transformação em 3D
![Page 20: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/20.jpg)
• Exercícios– Que transformação essa matriz faz?
– Reexpresse sem os parênteses
![Page 21: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/21.jpg)
Transformações Lineares
• Transformar um objeto é uma coisa
![Page 22: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/22.jpg)
Transformações Lineares
• Transformar a coordenada é outra
![Page 23: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/23.jpg)
Transformações Lineares
• Exemplo de rotação da coordenada
![Page 24: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/24.jpg)
Transformações Lineares
• Transf. objeto = - Transf. coordenada
![Page 25: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/25.jpg)
Rotação
• Rotação em 2D
![Page 26: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/26.jpg)
Rotação
• Rotação em 3D sobre eixos cardinais
![Page 27: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/27.jpg)
Rotação
• Rotação no eixo X
![Page 28: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/28.jpg)
Rotação
• Rotação no eixo Y
![Page 29: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/29.jpg)
Rotação
• Rotação no eixo Z
![Page 30: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/30.jpg)
Rotação
• Rotação sobre qualquer eixo– Tomem um café e se alongue antes– Queremos girar um vetor v qualquer, θ graus,
num eixo n
– Transformar v em dois vetores• Perpendicular• Paralelo
![Page 31: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/31.jpg)
Rotação• v|| é paralelo a n (projetado).
Então v|| é (v·n)n.• v┴ é perpendicular a n. Então
é v┴ = v – v||
• w (um vetor de referência) é perpendicular a v┴ e n (e mesmo comprimento de v┴.) Então é w = nv┴
![Page 32: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/32.jpg)
Rotação
![Page 33: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/33.jpg)
Rotação
• Iremos agora compor nossa matriz– Lembre-se: a matriz representa o conjunto de
vetores base após a transformação– Então iremos usar
• v = [1,0,0]• v = [0,1,0]• v = [0,0,1]
– Computar v’ de cada vetor base e juntar para fazer a matriz.
![Page 34: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/34.jpg)
Rotação
![Page 35: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/35.jpg)
Rotação
• Outros vetores-base– (calcula da mesma forma)
![Page 36: Vetores (Cont) E Matrizes](https://reader034.vdocuments.pub/reader034/viewer/2022052216/54967794b47959384d8b4f42/html5/thumbnails/36.jpg)
Rotação
• Tendo os 9 números, podemos compor a nossa matriz