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 Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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 ra = +(.5*sri).toFixed(e);
- var m = [+(sri*cosc).toFixed(e), +(sri*sinc).toFixed(e)];
- var ar = [[+(m[0] - ram*cosc).toFixed(e), +(m[1] - ram*sinc).toFixed(e)]];
- ar[1] = [+(ar[0][0] + ram*sinc).toFixed(e), +(ar[0][1] - ram*cosc).toFixed(e)];
- ar[2] = [+(m[0] + ram*sinc).toFixed(e), +(m[1] - ram*cosc).toFixed(e)];
- mp = [.5*(m[0] + ar[1][0]), .5*(m[1] + ar[1][1])]

svg(viewBox=[-d, -.5*d, 2*d, d].join(' ') 
		xmlns='http://www.w3.org/2000/svg')
	style
		| svg { fill: #{darken}; font: #{fs}px consolas, monaco, monospace }
		| svg > [d], [r], line { fill: none; stroke: #{llight}; stroke-width: #{2*sw} }
		| #e *, [d] + [x] { fill: #{llight} }
		| [x] +  [d] { marker-end: url(#e) }
		| [d] + [x] { font: 1em times new roman, serif }
		| [d] ~ [x] { font-style: italic }
		| [r] + * + [d] { fill: hsla(0, 0%, 83%, .7) }
		| line, [y2] ~ [d] { stroke: #{purple}; stroke-width: #{3*sw} }
		| [r] + [d] { stroke: #999 }
		| line ~ [r], [y2] ~ [d] { stroke: #{darken} }
		| line ~ [r] { fill: #{orange} }
		| [d] + * + [d] { stroke: #cb0; fill: rgba(255,238,51,.7) }
		| [y2] { stroke: #b9c }
		| [d] + [d] { stroke: #d97 }
		| [y2] + * + [d] { stroke: #{tomato} }
		| [cx] + line { stroke: #{orange}; stroke-width: #{4*sw} }
		| tspan { font-size: .5em }
	- for(var i = 0; i < sp; i++) {
		- var ca = i*sbac;
		- pts.push([+(srco*Math.cos(2*ca)).toFixed(e), +(srco*Math.sin(2*ca)).toFixed(e)]);
	- }
	marker#e(markerWidth=ad markerHeight=ad 
						viewBox='0 -4 8 8' 
						orient='auto' refX='7')
		path(d='M8 0 0-4V4')
	//-angle val labels
	text(x=srco y=.8*fs) 0°
	text(x=(pts[3][0] - .5*fs) y=(pts[3][1] + fs)) 72°
	text(x=(pts[1][0] - 1.875*fs).toFixed(e) y=pts[1][1] + fs) 144°
	//-axes
	path(d=`M${-ax} 0H${ax}`)
	text(x=ax - .5*fs y=-.5*fs) x
	text(x=(-.75*fs).toFixed(e) y=-.2*fs) O
	text(x=+(m[0] - .5*fs).toFixed(e) y=+(m[1] + fs).toFixed(e)) M
	path(d=`M0${-ax}V${ax}`)
	text(x=.4*fs y=(ax - .2*fs)) y
	//-inner pentagon inradius
	circle(r=+sri.toFixed(e))
	//-polygon
	path(d=`M${pts.slice(1).join(' ')} ${pts[0]}M${pts[3]} ${m}`)
	//-right triangle background
	path(d=`M${pts[0]} 0 0 ${m}`)
	//-pentagram circumradius
	circle(r=srco)
	//-radial
	path(d=`M0 0 ${ra} 0A${ra} ${ra} 0 0 1 ${+(ra*coss).toFixed(e)} ${+(ra*sins).toFixed(e)}`)
	//-circumradii
	line(x2=srco)
	line(x2=pts[1][0] y2=pts[1][1])
	//-perpendicularity
	path(d=`M${ar.join(' ')}`)
	//-edge
	path(d=`M${pts[0]} ${m}`)
	path(d=`M${m} ${pts[1]}`)
	- for(var i = 0; i < sp; i++) {
		circle(cx=pts[i][0] != 0 ? pts[i][0] : null 
					 cy=pts[i][1] != 0 ? pts[i][1] : null r=i?pr1:pr)
	- }
	line(x2=m[0] y2=m[1])
	circle(cx=mp[0] cy=mp[1] r=.2*pr)
	circle(r=pr)
	circle(cx=m[0] cy=m[1] r=pr)
	text(x=srco y=-.2*fs) V<tspan>0</tspan>
	text(x=pts[1][0] - 1.5*fs y=pts[1][1]) V<tspan>1</tspan>

// minimal SVG
<svg viewBox='-2500 -1250 5000 2500' xmlns='http://www.w3.org/2000/svg'><style>svg{fill:#333;font:150px consolas,monaco,monospace}svg>[d],[r],line{fill:none;stroke:#ccc;stroke-width:10}#e *,[d]+[x]{fill:#ccc}[x]+[d]{marker-end:url(#e)}[d]+[x]{font:1em times new roman,serif}[d]~[x]{font-style:italic}[r]+*+[d]{fill:hsla(0,0%,83%,.7)}line,[y2]~[d]{stroke:#95a;stroke-width:15}[r]+[d]{stroke:#999}line~[r],[y2]~[d]{stroke:#333}line~[r]{fill:#f90}[d]+*+[d]{stroke:#cb0;fill:rgba(255,238,51,.7)}[y2]{stroke:#b9c}[d]+[d]{stroke:#d97}[y2]+*+[d]{stroke:#b53}[cx]+line{stroke:#f90;stroke-width:20}tspan{font-size:.5em}</style><marker id='e' markerWidth='10' markerHeight='10' viewBox='0 -4 8 8' orient='auto' refX='7'><path d='M8 0 0-4V4'/></marker><text x='988' y='120'>0°</text><text x='230' y='1090'>72°</text><text x='-1080' y='731'>144°</text><path d='M-1230 0H1230'/><text x='1155' y='-75'>x</text><text x='-113' y='-30'>O</text><text x='19' y='440'>M</text><path d='M0-1230V1230'/><text x='60' y='1200'>y</text><circle r='305'/><path d='M-799 581 305-940 305 940-799-581 988 0M305 940 94 290'/><path d='M988 0 0 0 94 290'/><circle r='988'/><path d='M0 0 153 0A153 153 0 0 1-124 90'/><line x2='988'/><line x2='-799' y2='581'/><path d='M69 214 145 189 170 265'/><path d='M988 0 94 290'/><path d='M94 290-799 581'/><circle cx='988' r='25'/><circle cx='-799' cy='581' r='18'/><circle cx='305' cy='-940' r='18'/><circle cx='305' cy='940' r='18'/><circle cx='-799' cy='-581' r='18'/><line x2='94' y2='290'/><circle cx='112' cy='240' r='5'/><circle r='25'/><circle cx='94' cy='290' r='25'/><text x='988' y='-30'>V<tspan>0</tspan></text><text x='-1024' y='581'>V<tspan>1</tspan></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/eGLoba?editors=1000
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console