Draw {LearnGeom} | R Documentation |
Plots a geometric object
Description
Draw
plots geometric objects
Usage
Draw(object, colors = c("black", "black"), label = FALSE)
Arguments
object |
geometric object of any of these five types: point, segment, arc, line or polygon. A point is simply a vector of length 2, which contains the xy-coordinates for the point. For the other four types, there can be created with any of the following functions: |
colors |
Vector containing information about the color for the object to be plotted. In the case of polygons, the vector should have length 2 to define the background color and the border color (in this order). Moreover, it can be used |
label |
Boolean, only used for polygons. When |
Value
None. It produces the plot of a geometric object (point, segment, arc, line or polygon) in the current coordinate plane
Examples
x_min <- -5
x_max <- 5
y_min <- -5
y_max <- 5
CoordinatePlane(x_min, x_max, y_min, y_max)
P1 <- c(0,0)
P2 <- c(1,1)
P3 <- c(2,0)
Poly <- CreatePolygon(P1, P2, P3)
Draw(Poly, c("blue"))