ReflectedPolygon: Creates the reflection about a line of a given polygon

Description Usage Arguments Value Examples

View source: R/ReflectedPolygon.R

Description

ReflectedPolygon creates the reflection about a line of a given polygon

Usage

1
ReflectedPolygon(Poly, Line)

Arguments

Poly

Polygon object, previously created with function CreatePolygon or CreateRegularPolygon

Line

Line object previously created with CreateLinePoints or CreateLineAngle, to be used as the axis of symmetry

Value

Returns the reflection of a polygon about a line

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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, "blue")
P1 <- c(-3,2)
P2 <- c(1,-4)
Line <- CreateLinePoints(P1, P2)
Draw(Line, "black")
Poly_reflected <- ReflectedPolygon(Poly, Line)
Draw(Poly_reflected, "orange")

LearnGeom documentation built on July 14, 2020, 5:06 p.m.