In Mathematica, Ctrl+1 inserts a new picture. Using the drawing tool, we can draw many things. It seems to me that there is no way to control the drawing angle. So here are my questions:

  1. How to draw a regular polygon quickly and accurately? (e.g. a hexagon)
  2. How to draw a straight line with an accurate angle relative to the horizontal line? Or rotate an existing horizontal line for an angle (e.g. 60 degrees)?
  • $\begingroup$ Rotate[Line[{{0, 0}, {1, 0}}], 60 Degree, {0, 0}] $\endgroup$ – Vitaliy Kaurov Nov 27 '12 at 16:14

You can't do either with the current drawing tool but you can do such things programatically and edit the results using the drawing tool. For example, here's a hexagon

L = 10;
Graphics[Line[{{L, 0}, {L/2, L Sqrt[3]/2}, {-L/2, L Sqrt[3]/2}, {-L, 
    0}, {-L/2, -L Sqrt[3]/2}, {L/2, -L Sqrt[3]/2}, {L, 0}}]]

enter image description here

I believe that your original request would be a useful enhancement to the drawing tool.

  • 2
    $\begingroup$ << Polytopes``; Graphics@ GraphicsComplex[Vertices[Hexagon], Line@Join[Range@6, {1}]] :) $\endgroup$ – Dr. belisarius Nov 27 '12 at 10:30
  • 2
    $\begingroup$ Graphics@Line@Transpose@Through[{Re, Im}[Exp[\[Pi] I/3]^Range[0, 6]]] :) $\endgroup$ – Thies Heidecke Nov 27 '12 at 14:48
  • 5
    $\begingroup$ CycleGraph[6] ;) $\endgroup$ – Vitaliy Kaurov Nov 27 '12 at 16:18
  • $\begingroup$ Thank you all! all are good solutions. but after trying so many times. I give up drawing in mathematica and let the microsoft visio to do the job, and copy the drawing back into mathematica. maybe the best method is to tell the mathematca company to enhance their drawing tool, so I will not jump between different tools when I want to draw some simple illustrations during using mathematica. $\endgroup$ – matheorem Dec 1 '12 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.