Learn R Programming

gyro (version 1.3.0)

gyrotube: Gyrotube (tubular gyrosegment)

Description

Tubular gyrosegment joining two given 3D points.

Usage

gyrotube(A, B, s = 1, model = "U", n = 100, radius, sides = 90, caps = FALSE)

Value

A mesh3d object.

Arguments

A, B

distinct 3D points

s

positive number, the radius of the Poincaré ball if model="M", otherwise, if model="U", this number defines the hyperbolic curvature (higher value, less curved)

model

the hyperbolic model, either "M" (Möbius model, i.e. Poincaré model) or "U" (Ungar model, i.e. hyperboloid model)

n

number of points forming the gyrosegment

radius

radius of the tube around the gyrosegment

sides

number of sides in the polygon cross section

caps

Boolean, whether to put caps on the ends of the tube

Examples

Run this code
library(gyro)
library(rgl)
A <- c(1, 2, 0); B <- c(1, 1, 0)
tube <- gyrotube(A, B, s = 0.2, radius = 0.02)
shade3d(tube, color = "orangered")

# a 3D hyperbolic triangle ####
library(rgl)
A <- c(1, 0, 0); B <- c(0, 1, 0); C <- c(0, 0, 1)
s <- 0.3
r <- 0.03
AB <- gyrotube(A, B, s, radius = r)
AC <- gyrotube(A, C, s, radius = r)
BC <- gyrotube(B, C, s, radius = r)
view3d(30, 30, zoom = 0.75)
shade3d(AB, color = "gold")
shade3d(AC, color = "gold")
shade3d(BC, color = "gold")
spheres3d(rbind(A, B, C), radius = 0.04, color = "gold")

Run the code above in your browser using DataLab