Pentagram: Difference between revisions

No change in size ,  7 years ago
m
(→‎{{header|Tcl}}: added zkl)
Line 519:
Generate an SVG file to STDOUT. Redirect to a file to capture and display it.
<lang zkl>const DIM=200, SIDES=5, A=360/SIDES, R=DIM.toFloat();
vs:=[0.0..360-A,A].walkapply("toRad"); // angles of vertices
#<<<
0'|<?xml version="1.0" standalone="no" ?>
Line 529:
.fmt(DIM*2, DIM*2).println();
var vertices=vs.pump(List,fcn(a){ R.toRectangular(a.toRad()) }); //( (x,y), (x,y)...
SIDES.pump(String,pline).println(); // the line pairs that draw the pentagram
 
Anonymous user