cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              [[[https://codepen.io/thebabydino/pen/zEbVPO]]]

- var o = -.5*d, f = .1;
- var vb_y = -f*d, vb_x = o + vb_y;
- var ax0 = +((1 - k)*vb_y).toFixed(e);
- var ax1 = +((1 - k)*(d + vb_y)).toFixed(e);
- var r = +(.75*ax1).toFixed(e), rd = +(r/Math.sqrt(2)).toFixed(e);
- var dr = ax1 - r, c = Math.round(.551915*r);

svg(viewBox=[vb_x, vb_y, 2*d, d].join(' ') 
		xmlns='http://www.w3.org/2000/svg')
	style
		| * { fill: #{darken}; stroke-linecap: round; font: #{fs}px consolas, monaco, monospace }
		| [d], [r] { fill: none; stroke: #{orange}; stroke-width: #{2*sw} }
		| [x] + [d] { stroke: #{llight} }
		| [d*=A], [d*=h] { stroke-width: #{4*sw} }
		| [d*=A] { stroke: #{orange} }
		| [d*=A] + * { stroke: #{purple}; stroke-width: #{3*sw} }
		| [r] { fill: #{orange}; stroke: #{darken} }
		| [r] + * { word-spacing: #{-.35*fs}px }
		| [r] + [x] ~ * { font-style: italic }
	//-radius text on axes
	text(x=.5*(r - fs) y=-.2*fs) R
	//-axes + helper lines
	path(d=`M${ax0} 0H${ax1}M0${ax0}V${ax1}M${2*ram} 0V${2*ram}H0M${r - 2*ram} 0V${2*ram}H${r}M${2*ram} ${r}V${r - 2*ram}H0M${r} 0V${r}H0`)
	//-radius text on axes
	text(x=-.8*fs y=.5*(r + fs)) R
	//-perpendic dots
	path(d=`M${ram} ${ram}h1M${r - ram} ${ram}h1M${ram} ${r - ram}h1`)
	//-arc
	path(d=`M${r} 0A${r} ${r} 0 0 1 0 ${r}`)
	//-ctrl points guides
	path(d=`M${r} 0V${c}M0 ${r}H${c}`)
	//-meas
	text(x=(.5*c - fs) y=(r + .8*fs)) C·R
	text(x=(r + .2*fs) y=(.5*c + .4*fs)) C·R
	//-hl circles
	circle(r=pr1)
	circle(cx=r r=pr)
	circle(cy=r r=pr)
	circle(cx=r cy=c r=pr)
	circle(cx=c cy=r r=pr)
	circle(cx=r cy=r r=Math.round(.5*pr))
	//-legend
	text(x=ax1 y=ax1) C = .551915
	//-point names
	text(x=-.8*fs y=-.2*fs) O
	text(x=r - .2*fs y=-.3*fs) N
	text(x=r + .1*fs y=r + .6*fs) P
	text(x=-.8*fs y=r + .2*fs) Q

// minimal SVG
<svg viewBox='-1500 -250 5000 2500' xmlns='http://www.w3.org/2000/svg'><style>*{fill:#333;stroke-linecap:round;font:150px consolas,monaco,monospace}[d],[r]{fill:none;stroke:#f90;stroke-width:10}[x]+[d]{stroke:#ccc}[d*=A],[d*=h]{stroke-width:20}[d*=A]{stroke:#f90}[d*=A]+*{stroke:#95a;stroke-width:15}[r]{fill:#f90;stroke:#333}[r]+*{word-spacing:-53px}[r]+[x]~*{font-style:italic}</style><text x='727' y='-30'>R</text><path d='M-238 0H2138M0-238V2138M160 0V160H0M1444 0V160H1604M160 1604V1444H0M1604 0V1604H0'/><text x='-120' y='877'>R</text><path d='M80 80h1M1524 80h1M80 1524h1'/><path d='M1604 0A1604 1604 0 0 1 0 1604'/><path d='M1604 0V885M0 1604H885'/><text x='293' y='1724'>C·R</text><text x='1634' y='503'>C·R</text><circle r='18'/><circle cx='1604' r='25'/><circle cy='1604' r='25'/><circle cx='1604' cy='885' r='25'/><circle cx='885' cy='1604' r='25'/><circle cx='1604' cy='1604' r='13'/><text x='2138' y='2138'>C = .551915</text><text x='-120' y='-30'>O</text><text x='1574' y='-45'>N</text><text x='1619' y='1694'>P</text><text x='-120' y='1634'>Q</text></svg>
            
          
!
            
              body {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	margin: 0;
	height: 100vh;
}

svg { display: block }
            
          
!
            
              // minimal SVG: https://codepen.io/thebabydino/pen/pWqXLo?editors=1000
            
          
!
999px
Loading ..................

Console