This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Meshes | |
using MeshViz | |
using GLMakie | |
using LinearAlgebra | |
using Makie | |
using Printf | |
# image of circle (center, radius) by the inversion | |
# with center c and power k | |
function iotaCircle(c, k, center, radius) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Meshes | |
using MeshViz | |
using LinearAlgebra | |
using GLMakie | |
using Makie | |
using ColorSchemes | |
using Printf | |
# parameterization of the Hopf torus | |
function HopfTorus(u, v, nlobes, A) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Meshes | |
using Rotations | |
import TransformsBase as TB | |
using MeshViz | |
using GLMakie | |
function HopfFiber(q, t) | |
[ | |
q[1]*cos(t) + q[2]*sin(t), | |
sin(t)*(1 + q[3]), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MarchingCubes | |
import Meshes | |
using MeshViz | |
using GLMakie | |
using Makie | |
using Printf | |
# isosurface function f=0 | |
phi = (1 + sqrt(5)) / 2 | |
function f(x, y, z) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Meshes | |
using MeshViz | |
using GLMakie | |
function HopfTorus(u, nlobes, A) | |
t = [0, pi / 2, pi] | |
cos_v = cos.(t) | |
sin_v = sin.(t) | |
B = pi / 2 - (pi / 2 - A) * cos(u * nlobes) | |
C = u + A * sin(2 * u * nlobes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rgl) | |
#~~ Torus passing by three points ~~#### | |
## cross-product ### | |
crossProduct <- function(u, v) { | |
c( | |
u[2L]*v[3L] - u[3L]*v[2L], | |
u[3L]*v[1L] - u[1L]*v[3L], | |
u[1L]*v[2L] - u[2L]*v[1L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rgl) | |
# tetrahedra vertices | |
r <- 3*sqrt(3)/10 | |
theta <- acos(-2/3) | |
h <- 1/sqrt(10) | |
n <- 20 | |
i <- 1:n | |
p <- cbind(r*cos(i*theta), r*sin(i*theta), i*h) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rgl) | |
library(cgalMeshes) | |
# trefoil (2,3) #### | |
p <- function(theta, phi) { | |
c( | |
cos(theta)*cos(phi), cos(theta)*sin(phi), | |
sin(theta)*cos(1.5*phi), sin(theta)*sin(1.5*phi) | |
) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rgl) | |
library(cgalMeshes) | |
p <- function(theta, phi) { | |
c( | |
cos(theta)*cos(phi), cos(theta)*sin(phi), | |
sin(theta)*cos(phi), sin(theta)*sin(phi) | |
) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rgl) | |
library(cgalMeshes) | |
# Hopf fiber | |
HopfFiber <- function(p, t) { | |
c( | |
p[3L] * cos(t) + p[2L] * sin(t), | |
p[2L] * cos(t) - p[3L] * sin(t), | |
sin(t) * (1 + p[1L]), | |
cos(t) * (1 + p[1L]) |