Description Usage Arguments Examples
Spherical harmonics
1 | my.Legendre(k)
|
x, |
a matrix; num. of column = dimension |
R |
is a real value of radius |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | require(rgl)
require(RFOC)
require(Ronlyryamada)
k <- 20
Pms <- my.Legendre(k)
x <- seq(from=-1,to=1,length=100)
ys <- lapply(Pms,my.poly.calc,x)
plot(x,ys[[1]],type="l",ylim=c(-1,1))
for(i in 2:length(ys)){
points(x,ys[[i]],type="l",col=i)
}
n <- 6
A <- matrix(0,n,n)
ret <- matrix(list(),n,n)
for(i in 1:n){
for(j in 1:i){
A. <- A
A.[i,j] <- 1
ret[i,j] <- list(my.spherical.harm(A.))
}
}
tmp <- ret[4,1][[1]]
out <- rbind(tmp$X,rep(min(tmp$X),3),rep(max(tmp$X),3))
plot3d(out,type="l",col=rainbow(128))
col1 <- col2 <- rep(0,length(tmp$r))
col1[which(tmp$r>=0)] <- tmp$r[which(tmp$r>=0)]
col2[which(tmp$r<0)] <- -tmp$r[which(tmp$r<0)]
col1 <- col1/max(col1)
col2 <- col2/max(col2)
plot3d(tmp$X.,col=rgb(1-col1,1-col2,0),size=10)
n <- 6
A <- matrix(0,n,n)
ret <- matrix(list(),n,n)
for(i in 1:n){
for(j in 1:i){
A. <- A
A.[i,j] <- 1
ret[i,j] <- list(my.spherical.harm(A.))
}
}
# 半径そのまま
tmp <- ret[4,1][[1]]
out <- rbind(tmp$X,rep(min(tmp$X),3),rep(max(tmp$X),3))
plot3d(out,type="l",col=rainbow(128))
# 半径の2乗で
out.. <- rbind(tmp$X*tmp$r,rep(min(tmp$X*tmp$r),3),rep(max(tmp$X*tmp$r),3))
plot3d(out..,type="l",col=rainbow(128))
# 半径を色で
col1 <- col2 <- rep(0,length(tmp$r))
col1[which(tmp$r>=0)] <- tmp$r[which(tmp$r>=0)]
col2[which(tmp$r<0)] <- -tmp$r[which(tmp$r<0)]
col1 <- col1/max(col1)
col2 <- col2/max(col2)
plot3d(tmp$X.,col=rgb(1-col1,1-col2,0),size=10)
n <- 6
A <- matrix(0,n,n)
ret <- matrix(list(),n,n)
for(i in 1:n){
for(j in 1:i){
A. <- A
A.[1,1] <- 5 # 正円の分
A.[i,j] <- 1
ret[i,j] <- list(my.spherical.harm(A.))
}
}
tmp <- ret[4,1][[1]]
out <- rbind(tmp$X,rep(min(tmp$X),3),rep(max(tmp$X),3))
plot3d(out,type="l",col=rainbow(128))
n <- 6
A. <- matrix(runif(n^2),n,n)
A.[1,1] <- 5
xxx <- my.spherical.harm.mesh(A.,n=32)
plot3d(xxx$v)
segments3d(xxx$v[c(t(xxx$edge)),])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.