Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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)?
share|improve this question
    
Rotate[Line[{{0, 0}, {1, 0}}], 60 Degree, {0, 0}] –  Vitaliy Kaurov Nov 27 '12 at 16:14
1  
How about inventing a more distinguishable user name? –  Sjoerd C. de Vries Nov 28 '12 at 10:45

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
1  
<< Polytopes``; Graphics@ GraphicsComplex[Vertices[Hexagon], Line@Join[Range@6, {1}]] :) –  belisarius Nov 27 '12 at 10:30
2  
Graphics@Line@Transpose@Through[{Re, Im}[Exp[\[Pi] I/3]^Range[0, 6]]] :) –  Thies Heidecke Nov 27 '12 at 14:48
4  
CycleGraph[6] ;) –  Vitaliy Kaurov Nov 27 '12 at 16:18
    
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. –  matheorem Dec 1 '12 at 7:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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