SOCR ≫ | DSPA ≫ | Topics ≫ |
So far, we considered spacekime as 5D Euclidean space where the 2D kime is a flat space. Does it make sense to generalize kime to non-Euclidean manifold and what is the rationale and meaning of a curved kime manifold?
We saw earlier the geometric representation of the flat spacekime using conical shapes. Let’s start with some visualization of the non-Euclidean 2D kime manifold.
# Define a vase-generating funciton (2D), which will be rotated to form curved kime manifold
kime.manifold <- data.frame( s=seq(0, 1.3, length.out = 200) )
kime.manifold$theta <- seq(-pi, pi, length.out = 200)
g <- function (t) { sqrt(t^3-2.09*t^2+1.097*t) }
h <- function (t) { t }
#3D plot data
x2 <- g(kime.manifold$s) %o% cos(kime.manifold$theta)
y2 <- g(kime.manifold$s) %o% sin(kime.manifold$theta)
z2 <- h(kime.manifold$s) %o% rep(1, 200)
#2D plot data
xx2 <- g(kime.manifold$s) %o% cos(kime.manifold$theta)
yy2 <- rep(0,200*200)
zz2 <- h(kime.manifold$s) %o% rep(1, 200)
# calculate the diameter of every circle
xxx2<-as.vector(xx2)
zzz2<-as.vector(zz2)
newdata<-data.frame(zzz2,xxx2)
zzzz2<-as.matrix(zzz2)
#calculate every diameter
a=vector()
for(i in 1:200){
t=max(newdata[which(zzz2==zzzz2[i,]),2])
a=c(a,t)
}
#text the diameter and height of every circle
# phases
phi <- matrix(NA, nrow=200, ncol=200); dim(phi)
## [1] 200 200
## [,1] [,2] [,3] [,4] [,5]
## [1,] -3.141593 -3.110019 -3.078445 -3.046871 -3.015297
## [2,] -3.141593 -3.110019 -3.078445 -3.046871 -3.015297
## [3,] -3.141593 -3.110019 -3.078445 -3.046871 -3.015297
## [4,] -3.141593 -3.110019 -3.078445 -3.046871 -3.015297
## [5,] -3.141593 -3.110019 -3.078445 -3.046871 -3.015297
## [,1] [,2] [,3] [,4] [,5]
## [1,] 3.015297 3.046871 3.078445 3.110019 3.141593
## [2,] 3.015297 3.046871 3.078445 3.110019 3.141593
## [3,] 3.015297 3.046871 3.078445 3.110019 3.141593
## [4,] 3.015297 3.046871 3.078445 3.110019 3.141593
## [5,] 3.015297 3.046871 3.078445 3.110019 3.141593
mytext <- cbind(radius=a, height=zzz2[1:200], phi=phi[ ,1:200]); # tail(mytext)
custom_txt <- matrix(NA, nrow=200, ncol=200)
for (i in 1:200) {
for (j in 1:200) {
custom_txt[i,j] <- paste(' x: ', round(mytext[i, 2], 3),
'\n r: ', round(mytext[i, 1], 3),
'\n phi: ', round(kime.manifold$theta[j], 3))
}
}
dim(custom_txt); custom_txt[1:5,1:2]
## [1] 200 200
## [,1]
## [1,] " x: 0 \n r: 0 \n phi: -3.142"
## [2,] " x: 0.007 \n r: 0.084 \n phi: -3.142"
## [3,] " x: 0.013 \n r: 0.118 \n phi: -3.142"
## [4,] " x: 0.02 \n r: 0.144 \n phi: -3.142"
## [5,] " x: 0.026 \n r: 0.165 \n phi: -3.142"
## [,2]
## [1,] " x: 0 \n r: 0 \n phi: -3.11"
## [2,] " x: 0.007 \n r: 0.084 \n phi: -3.11"
## [3,] " x: 0.013 \n r: 0.118 \n phi: -3.11"
## [4,] " x: 0.02 \n r: 0.144 \n phi: -3.11"
## [5,] " x: 0.026 \n r: 0.165 \n phi: -3.11"
#plot 2D into 3D and make the text of the diameter (time), height (r), and phase (phi)
f <- list(family = "Courier New, monospace", size = 18, color = "black")
x <- list(title = "k1", titlefont = f)
y <- list(title = "k2", titlefont = f)
z <- list(title = "space (x)", titlefont = f)
plot_ly(x = ~xx2, y = ~yy2, z = ~zz2, type = "surface",
text = custom_txt, hoverinfo = "text", showlegend = FALSE) %>%
add_trace(x=~x2, y=~y2, z=~z2,
colors = c("blue", "yellow"),type="surface",
opacity=0.7, showscale = FALSE, showlegend = FALSE) %>%
# trace the main Z-axis
add_trace(x=0, y=0, z=~zz2[, 1], type="scatter3d", mode="lines",
line = list(width = 10, color="navy blue"), name="Space(x)",
hoverinfo="none", showlegend = FALSE) %>%
layout(dragmode = "turntable", title = "Non-Euclidean Kime Manifold (1D space, 2D kime)",
scene = list(xaxis = x, yaxis = y, zaxis = z), showlegend = FALSE)