S 3 行列式
3.1 例題3.1
2次元の場合行列Aの行列式の絶対値は,面積1の正方形を行列Aで変換した四角形の面積という意味を持つ.
## [1] 5
3.2 問題3.1
## [1] 4
a <- A[,1]
b <- A[,2]
c <- a + b
plot(0, 0, xlim=c(min(0,a[1],b[1],c[1]), max(0,a[1],b[1],c[1])),
ylim=c(min(0,a[2],b[2],c[2]), max(0,a[2],b[2],c[2])),
asp=1,xlab = "", ylab = "")
polygon(c(0, a[1], c[1], b[1]),c(0, a[2], c[2], b[2]),col = "skyblue")
## [1] 0
a <- A[,1]
b <- A[,2]
c <- a + b
plot(0, 0, xlim=c(min(0,a[1],b[1],c[1]), max(0,a[1],b[1],c[1])),
ylim=c(min(0,a[2],b[2],c[2]), max(0,a[2],b[2],c[2])),
asp=1,xlab = "", ylab = "")
polygon(c(0, a[1], c[1], b[1]),c(0, a[2], c[2], b[2]),col = "skyblue")
## rotate 45 degree
alpha <- pi*(45/180)
A <- matrix(c(cos(alpha),sin(alpha),-sin(alpha),cos(alpha)),2,2)
det(A)
## [1] 1
a <- A[,1]
b <- A[,2]
c <- a + b
plot(0, 0, xlim=c(min(0,a[1],b[1],c[1]), max(0,a[1],b[1],c[1])),
ylim=c(min(0,a[2],b[2],c[2]), max(0,a[2],b[2],c[2])),
asp=1,xlab = "", ylab = "")
polygon(c(0, a[1], c[1], b[1]),c(0, a[2], c[2], b[2]),col = "skyblue")
## [1] -24
## [1] 6
## [1] 3.996803e-15