Description Usage Arguments Value Examples
View source: R/ShearedPolygon.R
ShearedPolygon
creates a sheared polygon from a given one
1 | ShearedPolygon(Poly, k, direction)
|
Poly |
Polygon object, previously created with function |
k |
Number that represents the shear factor which is applied to the original polygon |
direction |
String with value "horizontal" or "vertical" which indicates the direction in which shearing is applied. Horizontal means the shearing is parallel to the X axis, while vertical means parallel to the Y axis |
Returns a sheared polygon, in any of the two axis, to the original one
1 2 3 4 5 6 7 8 9 10 11 12 | x_min <- -5
x_max <- 5
y_min <- -5
y_max <- 5
CoordinatePlane(x_min, x_max, y_min, y_max)
Square <- CreateRegularPolygon(4, c(-2, 0), 1)
Draw(Square, "blue")
k <- 1
Square_shearX <- Translate(ShearedPolygon(Square, k, "horizontal"), c(3,0))
Draw(Square_shearX, "orange")
Square_shearY <- Translate(ShearedPolygon(Square, k, "vertical"), c(3,0))
Draw(Square_shearY, "orange")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.