# NOT RUN {
Icosahedron( )
T <- EdgeSubdivision( n=2, k=2 )
T
ConvertBase( 10, 2, 6 ) # note order of digits
NumVertices( n=4, k=8, single=FALSE )
S <- rbind( diag(rep(1,2)), c(0,0) ) # solid simplex in 2D
PointCoord( S, T[,,1] )
SimplexCoord( S, T[,,1] )
SVIFromColor( S, T )
S1 <- rbind( c(0,0,0), diag( rep(1,3) ) )
S2 <- rbind( c(1,1,1), diag( rep(1,3) ) )
S3 <- rbind( c(1,1,1), c(0,1,0), c(1,0,0), c(1,1,0) )
S <- array( c(S1,S2,S3), dim=c(4,3,3) )
( H1 <- V2Hrep( S ) )
( S4 <- H2Vrep( H1 ) )
( H2 <- HrepCones( UnitSphere(n=2,k=1)$S )[,,2] ) # cone between 0 <= y <= x, x >= 0
x <- matrix( rnorm(100), ncol=2 )
( i <- SatisfyHrep( x, H2 ) )
x[i,]
(table <- matrix( c(1:12,1:3 ), ncol=3, byrow=TRUE ))
MatchRow( 1:3, table )
# }
# NOT RUN {
plot( Icosahedron( ), col="green" )
mesh <- SolidSimplex( n=3, k=2 )
plot(mesh, col="blue")
mesh2 <- AffineTransform( mesh, A=Rotate3D( rep(pi/2,3) ), shift=c(1,1,1) )
plot(mesh2, new.plot=FALSE, col="red" )
# }
Run the code above in your browser using DataLab