ReflectedPoint: Computes the reflected point about a line of a given point

Description Usage Arguments Value Examples

View source: R/ReflectedPoint.R

Description

ReflectedPoint computes the reflected point about a line of a given point

Usage

1
ReflectedPoint(P, Line)

Arguments

P

Vector containing the xy-coordinates of a point

Line

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

Value

Returns a vector which contains the xy-coordinates of the reflected point

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
x_min <- -5
x_max <- 5
y_min <- -5
y_max <- 5
CoordinatePlane(x_min, x_max, y_min, y_max)
xx <- c(0,1,2)
yy <- c(0,1,0)
P1 <- c(0,0)
P2 <- c(1,1)
Line <- CreateLinePoints(P1, P2)
Draw(Line, "black")
P <- c(-2,2)
Draw(P, "black")
reflected <- ReflectedPoint(P, Line)
Draw(reflected, "red")

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