Angle: Computes the angle between three points

Description Usage Arguments Value Examples

View source: R/Angle.R

Description

Angle computes the angle between three points

Usage

1
Angle(A, B, C, label = FALSE)

Arguments

A

Vector containing the xy-cooydinates of point A

B

Vector containing the xy-cooydinates of point B. This point acts as the vertex of angle ABC

C

Vector containing the xy-cooydinates of point C

label

Boolean. When label = TRUE, the plot displays the angle in the point that acts as the vertex. If missing, it works as with label = FALSE, so the angle is not displayed

Value

Angle between the three points in degrees

Examples

 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)
A <- c(-1,0)
B <- c(0,0)
C <- c(0,1)
Draw(CreatePolygon(A, B, C), "transparent")
angle <- Angle(A, B, C, label = TRUE)
angle <- Angle(A, C, B, label = TRUE)
angle <- Angle(B, A, C, label = TRUE)

Example output


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