Ask Your Question

How to draw figures of Polygons in SageMath

asked 2018-03-18 08:14:08 +0200

Captcha gravatar image

I want to draw a picture of a polygon in SageMath which will be unfilled i.e I want to draw figures of triangle,square,pentagon,hexagon and so on and then draw a figure with say 100 sides.

I checked the web.

I only found plots of 3d figures ,I want 2d figures .

Is it possible to draw such a figure in SageMath.

Please help me

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-03-18 20:11:31 +0200

slelievre gravatar image

updated 2018-03-22 23:27:42 +0200

Just use fill=False.

For example, let us draw a regular 12-gon.

sage: p = RDF.pi()
sage: n = 12
sage: pol = polygon([(cos(2*k*p/n), sin(2*k*p/n)) for k in range(n)], fill=False)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-03-18 08:14:08 +0200

Seen: 1,086 times

Last updated: Mar 22 '18