Jump to content

Yin and yang: Difference between revisions

m
(→‎{{header|JavaScript}}: add SVG (path evenodd))
Line 3,227:
 
function yinYang(r, x, y, th = 1) {
const cR = (dY, rad) => `M${x},${y + dY + rad} a${rad},${rad},0,1,1,.1,0z `;
const arc = (dY, rad, cw = 1) => `A${rad},${rad},0,0,${cw},${x},${y + dY} `;
const d = cR(0, r + th) + cR(r / 2, r / 6) + cR(-r / 2, r / 6)
+ `M${x},${y} ` + arc(r, r / 2, 0) + arc(-r, r) + arc(0, r / 2);
const path = document.createElementNS(NS, 'path');
path.setAttribute('d', d);
106

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.