Angle {LearnGeom}R Documentation

Computes the angle between three points

Description

Angle computes the angle between three points

Usage

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

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)

[Package LearnGeom version 1.5 Index]