Incenter: Computes the incenter of a given triangle

Description Usage Arguments Value References Examples

View source: R/Incenter.R

Description

Incenter computes the center of a triangle

Usage

1
Incenter(Tri, lines = F)

Arguments

Tri

Triangle object, previously created with function CreatePolygon

lines

Boolean. When lines = TRUE, the plot displays the lines that bisect each of the angles of the triangle. If missing, it works as with lines = FALSE, so the lines are not displayed

Value

Vector which contains the xy-coordinates of the incenter of the triangle

References

http://mathworld.wolfram.com/Incenter.html

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
P1 <- c(0,0)
P2 <- c(1,1)
P3 <- c(2,0) 
Tri <- CreatePolygon(P1, P2, P3)
x_min <- -5
x_max <- 5
y_min <- -5
y_max <- 5
CoordinatePlane(x_min, x_max, y_min, y_max)
Draw(Tri, "transparent")
I <- Incenter(Tri, lines = TRUE)
Draw(I, "red")

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