MIKUセミナー 世界地図の数理

MikuHatsune2012-04-13

数学セミナー4月号の記事。
不動点について。
世界地図を2枚用意して、1枚は広げ、一方はくしゃくしゃにして広げた地図の上に放り投げる。
すると、広げた地図とくしゃくしゃに丸めた地図で、上から見て対応する座標はただひとつしかないらしい。
 
生物学的な意味合いとしては、二次構造のDNAが一次構造のDNAにどう対応するか、とかか?
証明はAOあたりが書いてくれるだろうから、本中でやっていたシミュレーションをRでやる。

#行列回転・縮小の関数
Rot <- function(pos, rot_center = c(0, 0), theta, expand=1){
	posmat <- matrix(c(pos), 2, 1) - matrix(rot_center , 2, 1)
	Rot_mat <- matrix(c(cos(theta), sin(theta), -sin(theta), cos(theta)), 2, 2)
	Rot_after <- (Rot_mat %*% posmat) * expand + matrix(rot_center, 2, 1)
	rownames(Rot_after) <- c("x", "y")
	return(Rot_after)
}
#格子
x <- rep(1:20, each=20)
y <- rep(1:20, length(unique(x)))
rot_center <- c(3.3, 2.2)
xy <- cbind(x, y)
rot <- seq(0, 0.2, length=5)
exvec <- seq(1, 1, length=length(rot))
xy_rot <- array(xy, c(length(x), 2, length(rot) + 1))
for(r in 1:length(rot)){
	xy_rot[, , r + 1] <- t(apply(xy_rot[, , 1], 1, Rot, rot_center=rot_center, theta=pi * rot[r], expand=exvec[r]))
}
col <- rainbow(length(rot))
#png("格子.png")
for(s in 1:dim(xy_rot)[3]){
	plot(xy_rot[, 1, s], xy_rot[, 2, s], xlim=xlim, ylim=ylim, col=col[s], pch=16, cex=0.3, xlab="", ylab="", frame=FALSE, axes=FALSE)
	par(new=TRUE)
}
points(x=rot_center[1], y=rot_center[2], col=4, pch=3)
par(new=FALSE)
#dev.off()

x <- runif(100)
y <- runif(100)
rot_center <- c(0.3, 0.2)
xy <- cbind(x, y)
rot <- seq(0, 2, length=100)
exvec <- seq(1, 1, length=length(rot))
#exvec <- seq(1, 0, length=length(rot)) #収束させる場合
xy_rot <- array(xy, c(length(x), 2, length(rot) + 1))
for(r in 1:length(rot)){
	xy_rot[, , r + 1] <- t(apply(xy_rot[, , 1], 1, Rot, rot_center=rot_center, theta=pi * rot[r], expand=exvec[r]))
}
xlim <- range(xy_rot[, 1, ])
ylim <- range(xy_rot[, 2, ])
col <- rainbow(length(rot))
#png("回転.png")
for(s in 1:dim(xy_rot)[3]){
	plot(xy_rot[, 1, s], xy_rot[, 2, s], xlim=xlim, ylim=ylim, col=col[s], pch=16, cex=0.3, xlab="", ylab="", frame=FALSE, axes=FALSE)
	par(new=TRUE)
}
points(x=rot_center[1], y=rot_center[2], col=4, pch=3)
par(new=FALSE)
#dev.off()