Skip to contents

A() and aa() draw elliptical arc curve commands.

Usage

A(
  rx,
  ry = rx,
  x_axis_rotation = -a,
  large_arc_flag = big,
  sweep_flag = cw,
  x,
  y = NULL,
  ...,
  sep = getOption("dee.sep", ","),
  origin_at_bottom = getOption("dee.origin_at_bottom", FALSE),
  height = getOption("dee.height", NULL),
  digits = getOption("dee.digits", Inf),
  a = 0,
  cw = FALSE,
  big = FALSE
)

aa(
  rx,
  ry = rx,
  x_axis_rotation = 0,
  large_arc_flag = FALSE,
  sweep_flag = FALSE,
  x,
  y = NULL,
  ...,
  sep = getOption("dee.sep", ","),
  origin_at_bottom = getOption("dee.origin_at_bottom", FALSE),
  height = getOption("dee.height", NULL),
  digits = getOption("dee.digits", Inf)
)

AZ(...)

az(...)

Arguments

rx, ry

Radius of ellipse.

x_axis_rotation, a

Angle (in degrees) to rotate ellipse clockwise. Will be coerced by affiner::degrees(). If isTRUE(origin_at_bottom) then will be multiplied by -1 in the output. a is an alternative that instead rotates the ellipse counter-clockwise.

large_arc_flag, big

If TRUE then the arc will be one of two larger arc sweeps else one of the two smaller arc sweeps. big is an alias.

sweep_flag, cw

If TRUE then the arc will be one of the two possible arcs in the "clockwise" direction. else one of the two in a "counter-clockwise" direction. If isTRUE(origin_at_bottom) then will be inverted in the output. cw is an alias.

x

If y is NULL will be coerced by affiner::as_coord2d(). Else a numeric vector.

y

Either NULL or a numeric vector.

...

Passed to related function.

sep

Either "," or " ".

origin_at_bottom, height

If origin_at_bottom is TRUE then y (and any y1 and y2) coordinates is transformed by height - y for absolute coordinates and -y for relative coordinates.

digits

x and y (and any x1, y1, x2, y2) will be transformed by round(, digits). An Inf (default) means no rounding.

Value

A dee() object.

Examples

M(1, 1) + A(rx = 1, x = 2, y = 2) + Z()
#> <dee[1]>
#> M 1,1 A 1,1 0,0,0 2,2 Z
M(1, 1) + aa(rx = 1, x = 1, y = 1) + zz()
#> <dee[1]>
#> M 1,1 a 1,1 0,0,0 1,1 z
d_small_ccw <- M(40, 70) + A(rx = 20, ry = 30, x = 20, y = 20)
d_small_cw <- M(40, 70) + A(rx = 20, ry = 30, x = 20, y = 20, cw = TRUE)
d_big_ccw <- M(40, 70) + A(rx = 20, ry = 30, x = 20, y = 20, big = TRUE)
d_big_cw <- M(40, 70) + A(rx = 20, ry = 30, x = 20, y = 20, big = TRUE, cw = TRUE)
if (requireNamespace("omsvg", quietly = TRUE) &&
    requireNamespace("nanosvgr", quietly = TRUE)) {
  plot(c(d_small_ccw, d_small_cw, d_big_ccw, d_big_cw),
    height = 100, width = 100,
    stroke = c("black", "grey", "blue", "cyan"),
    fill = "none", stroke_width = 4)
}