Convert Circle or Ellipse to Path

If the radius(r) and center(cx,cy) point are known, the circle or ellipse can be converted to a path which includes 2 arcs.
Typical Conversion:
d=
  [
    "M",cx,cy,
    "m",-r,0,
    "a",r,r,
    0,1,0,2*r, 0,
    "a",r,r,
    0,1,0,-2*r, 0
  ]

Ellipse:
d=
  [
    "M",cx,cy,
    "m",-rx,0,
    "a",rx,ry,
    0,1,0,2*rx, 0,
    "a",rx,ry,
    0,1,0,-2*rx, 0
  ]

then...
d.join(" ")
SVG Source:
Javascript: