R Under development (unstable) (2023-04-23 r84305 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > > library(rcdd) If you want correct answers, use rational arithmetic. See the Warnings sections in help pages for functions that do computational geometry. > > x <- seq(10, 90, 10) > x <- x[x != 50] > y <- as.numeric(x > 50) > m <- cbind(1, x) > > tanv <- m > tanv[y == 1, ] <- (-tanv[y == 1, ]) > tanv x [1,] 1 10 [2,] 1 20 [3,] 1 30 [4,] 1 40 [5,] -1 -60 [6,] -1 -70 [7,] -1 -80 [8,] -1 -90 > > makeV(points = tanv) x [1,] 0 1 1 10 [2,] 0 1 1 20 [3,] 0 1 1 30 [4,] 0 1 1 40 [5,] 0 1 -1 -60 [6,] 0 1 -1 -70 [7,] 0 1 -1 -80 [8,] 0 1 -1 -90 attr(,"representation") [1] "V" > makeV(rays = tanv) x [1,] 0 0 1 10 [2,] 0 0 1 20 [3,] 0 0 1 30 [4,] 0 0 1 40 [5,] 0 0 -1 -60 [6,] 0 0 -1 -70 [7,] 0 0 -1 -80 [8,] 0 0 -1 -90 attr(,"representation") [1] "V" > makeV(lines = tanv) x [1,] 1 0 1 10 [2,] 1 0 1 20 [3,] 1 0 1 30 [4,] 1 0 1 40 [5,] 1 0 -1 -60 [6,] 1 0 -1 -70 [7,] 1 0 -1 -80 [8,] 1 0 -1 -90 attr(,"representation") [1] "V" > > > proc.time() user system elapsed 0.23 0.03 0.23