| EllipticalArc {PlaneGeometry} | R Documentation |
R6 class representing an elliptical arc
Description
An arc is given by an ellipse (Ellipse object),
a starting angle and an ending angle. They are respectively named
ell, alpha1 and alpha2.
Active bindings
ellget or set the ellipse
alpha1get or set the starting angle
alpha2get or set the ending angle
degreesget or set the
degreesfield
Methods
Public methods
Method new()
Create a new EllipticalArc object.
Usage
EllipticalArc$new(ell, alpha1, alpha2, degrees = TRUE)
Arguments
ellthe ellipse
alpha1the starting angle
alpha2the ending angle
degreeslogical, whether
alpha1andalpha2are given in degrees
Returns
A new EllipticalArc object.
Examples
ell <- Ellipse$new(c(-4,0), 4, 2.5, 140) EllipticalArc$new(ell, 45, 90)
Method print()
Show instance of an EllipticalArc object.
Usage
EllipticalArc$print(...)
Arguments
...ignored
Method startingPoint()
Starting point of the reference elliptical arc.
Usage
EllipticalArc$startingPoint()
Method endingPoint()
Ending point of the reference elliptical arc.
Usage
EllipticalArc$endingPoint()
Method isEqual()
Check whether the reference elliptical arc equals another elliptical arc.
Usage
EllipticalArc$isEqual(arc)
Arguments
arcan
EllipticalArcobject
Method complementaryArc()
Complementary elliptical arc of the reference elliptical arc.
Usage
EllipticalArc$complementaryArc()
Examples
ell <- Ellipse$new(c(-4,0), 4, 2.5, 140)
arc <- EllipticalArc$new(ell, 30, 60)
plot(NULL, type = "n", asp = 1, xlim = c(-8,0), ylim = c(-3.2,3.2),
xlab = NA, ylab = NA)
draw(arc, lwd = 3, col = "red")
draw(arc$complementaryArc(), lwd = 3, col = "green")
Method path()
The reference elliptical arc as a path.
Usage
EllipticalArc$path(npoints = 100L)
Arguments
npointsnumber of points of the path
Returns
A matrix with two columns x and y of length
npoints.
Method length()
The length of the elliptical arc.
Usage
EllipticalArc$length()
Returns
A number, the arc length.
Method clone()
The objects of this class are cloneable with this method.
Usage
EllipticalArc$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.
Examples
## ------------------------------------------------
## Method `EllipticalArc$new`
## ------------------------------------------------
ell <- Ellipse$new(c(-4,0), 4, 2.5, 140)
EllipticalArc$new(ell, 45, 90)
## ------------------------------------------------
## Method `EllipticalArc$complementaryArc`
## ------------------------------------------------
ell <- Ellipse$new(c(-4,0), 4, 2.5, 140)
arc <- EllipticalArc$new(ell, 30, 60)
plot(NULL, type = "n", asp = 1, xlim = c(-8,0), ylim = c(-3.2,3.2),
xlab = NA, ylab = NA)
draw(arc, lwd = 3, col = "red")
draw(arc$complementaryArc(), lwd = 3, col = "green")