2
$\begingroup$

I have a set of circles defined by a Middlepoint and a radius e.g.

Circle1: x = 10, y = 10, r = 3
Circle2: x = 15, y = 2, r = 10
etc...

But I want to have them converted to Hexagons, do you know any formulas to calculate the 6 edge coordinates for them?

$\endgroup$

closed as off-topic by Szabolcs, Edmund, m_goldberg, happy fish, C. E. Sep 28 '16 at 9:08

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Edmund, m_goldberg, happy fish, C. E.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ Polygon[CirclePoints[6]] $\endgroup$ – george2079 Sep 27 '16 at 19:08
  • $\begingroup$ Thank you for answering but how to get those 6 points is the question $\endgroup$ – LuaNoob Sep 27 '16 at 19:16
  • $\begingroup$ did you read the docs for CirclePoints ? $\endgroup$ – george2079 Sep 27 '16 at 19:20
  • $\begingroup$ Sorry im quite new to this, where can i find those docs? $\endgroup$ – LuaNoob Sep 27 '16 at 19:23
  • $\begingroup$ type CirclePoints and press "F1". The docs are also online: reference.wolfram.com/language/ref/CirclePoints.html $\endgroup$ – george2079 Sep 27 '16 at 19:28
6
$\begingroup$

The documentation can be found here: CirclePoints or here: RegularPolygon. You can convert a circle into a hexagon via the replacement rule Circle[x_, y_] :> Polygon[CirclePoints[x, y, 6]], or Circle[x_, y_] :> RegularPolygon[x, y, 6]

Here it is with 7 random circles,

circles = 
  Table[Circle[RandomReal[{-10, 10}, 2], RandomReal[{1, 2}]], {n, 
    7}];
Graphics@circles

Mathematica graphics

Graphics[{EdgeForm[Black], FaceForm[None], 
  circles /. Circle[x_, y_] :> RegularPolygon[x, y, 6]}]

Mathematica graphics

$\endgroup$
  • $\begingroup$ But how do I get the coordinates of them or better where can i draw them like you i cant find it $\endgroup$ – LuaNoob Sep 27 '16 at 19:44
  • $\begingroup$ What coordinates? The coordinates for the six points of the hexagon? $\endgroup$ – Jason B. Sep 27 '16 at 19:46
  • $\begingroup$ i guess I know how to get those points I saw in the Docs, but where can I draw them like you did? $\endgroup$ – LuaNoob Sep 27 '16 at 19:47
  • 1
    $\begingroup$ Start with this: pts = CirclePoints[{1,1},2,6]; Print[pts]; hexagon = Polygon[pts]; Graphics[hexagon] $\endgroup$ – Jason B. Sep 27 '16 at 19:49
  • $\begingroup$ I cant find the Internet Site you are using with it.. $\endgroup$ – LuaNoob Sep 27 '16 at 19:52

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