changesOfSign {gyro} | R Documentation |
Changes of sign
Description
Sometimes, the coordinates of the vertices of a polyhedron are given with changes of sign (with a symbol +/-). This function performs the changes of sign.
Usage
changesOfSign(M, changes = "all")
Arguments
M |
a numeric matrix of coordinates of some points (one point per row) |
changes |
either the indices of the columns of |
Value
A numeric matrix, M
transformed by the changes of sign.
Examples
library(gyro)
library(rgl)
## ~~ rhombicosidodecahedron ~~##
phi <- (1 + sqrt(5)) / 2
vs1 <- rbind(
c(1, 1, phi^3),
c(phi^2, phi, 2 * phi),
c(2 + phi, 0, phi^2)
)
vs2 <- rbind(vs1, vs1[, c(2, 3, 1)], vs1[, c(3, 1, 2)]) # even permutations
vs <- changesOfSign(vs2)
open3d(windowRect = c(50, 50, 562, 562), zoom = 0.65)
plotGyrohull3d(vs)
[Package gyro version 1.4.0 Index]