#Header Begins--Do not remove################################################## # # Maple code to plot a regular n-gon inscribing a circle of diameter 1. # # (c) Eugene Fiume, University of Toronto, 1995. # # You are permitted to use this code for noncommercial, educational # purposes only. This header must not be removed from this file. # #Header Ends--Do not remove#################################################### x := proc(t) 1/2*cos(t); end: y := proc(t) 1/2*sin(t); end: circle := proc() plot([x(t),y(t), t=0..2*Pi]); end: ngon := proc(n) local i,pts; pts := [[x(i*2*Pi/n),y(i*2*Pi/n)] $ i=0..n]; plot({[x(t),y(t), t=0..2*Pi],pts},style=LINE, title=`Unit circle and inscribing regular n-gon`); end: # # Sample executions: # # ngon(5); # ngon(10); # ngon(20);