| Arc | R Documentation |
An arc is given by a center, a radius, a starting angle and
an ending angle. They are respectively named center, radius,
alpha1 and alpha2.
centerget or set the center
radiusget or set the radius
alpha1get or set the starting angle
alpha2get or set the ending angle
degreesget or set the degrees field
new()Create a new Arc object.
Arc$new(center, radius, alpha1, alpha2, degrees = TRUE)
centerthe center
radiusthe radius
alpha1the starting angle
alpha2the ending angle
degreeslogical, whether alpha1 and alpha2 are
given in degrees
A new Arc object.
arc <- Arc$new(c(1,1), 1, 45, 90) arc arc$center arc$center <- c(0,0) arc
print()Show instance of an Arc object.
Arc$print(...)
...ignored
Arc$new(c(0,0), 2, pi/4, pi/2, FALSE)
startingPoint()Starting point of the reference arc.
Arc$startingPoint()
endingPoint()Ending point of the reference arc.
Arc$endingPoint()
isEqual()Check whether the reference arc equals another arc.
Arc$isEqual(arc)
arcan Arc object
complementaryArc()Complementary arc of the reference arc.
Arc$complementaryArc()
arc <- Arc$new(c(0,0), 1, 30, 60)
plot(NULL, type = "n", asp = 1, xlim = c(-1,1), ylim = c(-1,1),
xlab = NA, ylab = NA)
draw(arc, lwd = 3, col = "red")
draw(arc$complementaryArc(), lwd = 3, col = "green")
path()The reference arc as a path.
Arc$path(npoints = 100L)
npointsnumber of points of the path
A matrix with two columns x and y of length
npoints. See "Filling the lapping area of two circles" in the
vignette for an example.
clone()The objects of this class are cloneable with this method.
Arc$clone(deep = FALSE)
deepWhether to make a deep clone.
## ------------------------------------------------
## Method `Arc$new`
## ------------------------------------------------
arc <- Arc$new(c(1,1), 1, 45, 90)
arc
arc$center
arc$center <- c(0,0)
arc
## ------------------------------------------------
## Method `Arc$print`
## ------------------------------------------------
Arc$new(c(0,0), 2, pi/4, pi/2, FALSE)
## ------------------------------------------------
## Method `Arc$complementaryArc`
## ------------------------------------------------
arc <- Arc$new(c(0,0), 1, 30, 60)
plot(NULL, type = "n", asp = 1, xlim = c(-1,1), ylim = c(-1,1),
xlab = NA, ylab = NA)
draw(arc, lwd = 3, col = "red")
draw(arc$complementaryArc(), lwd = 3, col = "green")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.