d_ellipse() is a wrapper around M() and AZ() to create
ellipse shaped paths.
It's vectorized in its x, y, rx, and ry arguments.
d_circle() is a special case to create circle shaped paths.
It's vectorized in its x, y, and r arguments.
Arguments
- x
If
yisNULLwill be coerced byaffiner::as_coord2d(). Else a numeric vector.- y
Either
NULLor a numeric vector.- rx, ry
The radii of the ellipse.
- a
The angle of rotation (will be coerced by
affiner::degrees()).- ...
- origin_at_bottom, height
If
origin_at_bottomisTRUEtheny(and anyy1andy2) coordinates is transformed byheight - yfor absolute coordinates and-yfor relative coordinates.- r
The radius of the circle.
Value
A dee() object.
Examples
d_circle(x = 5, y = 5, r = 2)
#> <dee[1]>
#> M 5,7 A 2,2 0,0,0 5,3 2,2 0,0,0 5,7 Z
d_ellipse(x = 5, y = 5, rx = 2, ry = 3)
#> <dee[1]>
#> M 5,8 A 2,3 0,0,0 5,2 2,3 0,0,0 5,8 Z
if (requireNamespace("omsvg", quietly = TRUE) &&
requireNamespace("nanosvgr", quietly = TRUE)) {
plot(d_ellipse(x = 5, y = 5, rx = 2, ry = 3),
height = 10, width = 10,
fill = "red", stroke = "black", stroke_width = 4)
}