Learn R Programming

TML (version 2.3.0)

draw.tpolytope: Draw a 2-D or 3-D tropical polytope

Description

This command draws a three dimensional tropical polytope

Usage

draw.tpolytope.3d(D, col_lines, col_verts, plot = TRUE, tadd = max)

draw.tpolytope.2d(D, col_lines, col_verts, plot = TRUE, tadd = max)

Value

2-D or 3-D rendering of a tropical polytope.

Arguments

D

matrix of vertices of a tropical polytope; rows are the vertices

col_lines

string; color to render the polytope.

col_verts

string; color to render the vertices.

plot

logical; initiate new plot visualization or not.

tadd

function; max indicates max-plus addition, min indicates min-plus addition. Defaults to max

Author

Ruriko Yoshida ryoshida@nps.edu

Examples

Run this code
D <-matrix(c(0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),4,4,TRUE)
col_lines<-'blue'
col_verts<-'red'
draw.tpolytope.3d(D,col_lines,col_verts,plot=TRUE)
draw.tpolytope.3d(D,col_lines,col_verts,plot=TRUE,tadd=min)

D <- matrix(c(0,-2,2,0,-2,5,0,2,1,0,1,-1),4,3,TRUE)
col_lines <- 'blue'
col_verts <- 'red'
draw.tpolytope.2d(D,col_lines,col_verts,plot=TRUE)
draw.tpolytope.2d(D,col_lines,col_verts,plot=TRUE,tadd=min)

Run the code above in your browser using DataLab