CreateArcAngles {LearnGeom}R Documentation

Creates an arc of a circumference

Description

CreateArcAngles creates an arc of a circumference

Usage

CreateArcAngles(C, r, angle1, angle2, direction = "anticlock")

Arguments

C

Vector containing the xy-coordinates of the center of the circumference

r

Radius for the circumference (or arc)

angle1

- Angle in degrees (0-360) at which the arc starts

angle2

- Angle in degrees (0-360) at which the arc finishes

direction

- String indicating the direction which is considered to create the arc, from the smaller to the higher angle. It has two possible values: "clock" (clockwise direction) and "anticlock" (anti-clockwise direction)

Value

Returns a vector which contains the center, radius, angles (0-360) and direction (1 - "clock", 2 - "anticlock") that define the created arc

Examples

x_min <- -5
x_max <- 5
y_min <- -5
y_max <- 5
CoordinatePlane(x_min, x_max, y_min, y_max)
C <- c(0,0)
r <- 3
angle1 <- 90
angle2 <- 180
direction <- "anticlock"
Arc1 <- CreateArcAngles(C, r, angle1, angle2, direction)
Draw(Arc1, "black")
direction <- "clock"
Arc2 <- CreateArcAngles(C, r, angle1, angle2, direction)
Draw(Arc2, "red")

[Package LearnGeom version 1.5 Index]