CreateArcAngles: Creates an arc of a circumference

Description Usage Arguments Value Examples

View source: R/CreateArcAngles.R

Description

CreateArcAngles creates an arc of a circumference

Usage

1
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

 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)
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")

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