Ask Your Question
1

How to draw figures of Polygons in SageMath

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

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
1

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

slelievre gravatar image

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

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)
sage: pol.show(aspect_ratio=1)
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

Stats

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

Seen: 1,149 times

Last updated: Mar 22 '18