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
.
center
get or set the center
radius
get or set the radius
alpha1
get or set the starting angle
alpha2
get or set the ending angle
degrees
get or set the degrees
field
new()
Create a new Arc
object.
Arc$new(center, radius, alpha1, alpha2, degrees = TRUE)
center
the center
radius
the radius
alpha1
the starting angle
alpha2
the ending angle
degrees
logical, 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)
arc
an 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)
npoints
number 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)
deep
Whether 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.