- 昨日の記事で、共形変換による閉領域の単位円板対応では、外周の曲率を対応点の粗密にするとよいのでは、ということになった
- さて
- 単位円板を単位円板に移しつつ、その外周粗密を変えるときの変換はどうするか?
- 外周は「ふりふり」になる様子が見える。これは細胞の変形のときの様子?
t <- seq(from=0,to=1,length=500) * 2 * pi
x <- cos(t)+10
y <- sin(t)+20
z <- x + 1i * y
library(MCMCpack)
k <- 5
as <- c(rdirichlet(1,rep(1,k)))
my.conf.transform <- function(z,as){
tmp <- rep(as[1],length(z))
if(length(as)>1){
for(i in 2:length(as)){
tmp <- tmp + as[i] * z^(i-1)
}
}
tmp
}
my.f.unit.disk <- function(g){
if(is.null(g)){
t <- seq(from=0,to=1,length=501) * 2 * pi
t <- t[-length(t)]
x <- cos(t)
y <- sin(t)
z <- x + 1i * y
}else{
g. <- (g-min(g))/(max(g)-min(g))*2*pi
g. <- g.[-length(g.)]
x <- cos(g.)
y <- sin(g.)
z <- x+ 1i * y
}
z
}
t <- seq(from=0,to=1,length=50) * 2*pi
g <- (5*sin(t) + 5*sin(t*2) )/15 + t
plot(g)
x <- cos(t)
y <- sin(t)
z <- x + 1i * y
z <- z[-length(z)]
Z <- my.f.unit.disk(g)
Z <- Z
plot(Z)
plot(c(z,Z+3),col=rep(1:2,each=length(z)))
my.conformal.coef <- function(zn,wn){
n <- length(zn)
W <- c(Re(wn),Im(wn))
Z <- matrix(0,2*n,2*n)
for(i in 1:n){
tmp <- zn[i]^(0:(n-1))
Z[i,] <- c(Re(tmp),-Im(tmp))
Z[n+i,] <- c(Im(tmp),Re(tmp))
Z[i,n+1] <- Z[n+i,1] <- 0
}
solve(Z) %*% W
}
tmp.out <- my.conformal.coef(z,Z)
tmp.out.mat <- matrix(tmp.out,ncol=2)
as.est <- tmp.out.mat[,1] + 1i * tmp.out.mat[,2]
Z. <- my.conf.transform(z,as.est)
plot(Z)
points(Z.,col=2)
t <- seq(from=0,to=1,length=300)*2*pi
t <- t[-1]
r <- seq(from=0,to=1,length=100)
x <- y <- c()
for(i in 1:length(r)){
tmp.t <- t
x <- c(x,r[i]*cos(tmp.t))
y <- c(y,r[i]*sin(tmp.t))
}
z2 <- x + 1i * y
z2 <- c(z2,z)
plot(z2)
Z... <- my.conf.transform(z,as.est)
plot(Z...)
Z.. <- my.conf.transform(z2,as.est)
plot(Z..)
points(Z...,type="l")
par(mfcol=c(1,2))
col1 <- Mod(Z..) * length(r)
plot(Z..,type="b",cex=0.1,col=rep(1:length(t),length(r)),pch=20,asp=TRUE)
col2 <- (Arg(Z..)+pi)/(2*pi) * 100
plot(Z..,type="b",cex=0.1,col=rep(1:length(t),each=length(r)),pch=20,asp=TRUE)
par(mfcol=c(1,1))