Hauke - you are correct. A hexagon can be thought of as six equilateral triangles. Bo - you are correct only for an unscaled hexagon. See how "'aspect 1' plot 0.5*_1^3%~i.7" looks.
Thanks everyone, Devon On Mon, Feb 8, 2021 at 8:53 AM 'Bo Jacoby' via Programming < [email protected]> wrote: > 'aspect 1'plot _1^3%~i.7 > > > Den mandag den 8. februar 2021 07.22.39 CET skrev Hauke Rehr < > [email protected]>: > > The picture is Very Wrong™ (but the area formula is correct) > The lengths of the not-horizontal lines are interchanged. > And it looks distorted but that’s not too bad. > > And then it should be r =. sideOfUnitHexagon > which is obviously due to the same confusion > as the mislabelled lines. > > Just think of the hexagon cut into six triangles. > They’ll be regular as well, so radius = side. > > Another way to see this is to remember you can > construct a regular hex by taking a circle and > repeatedly go around that circle finding > intersections at one radius distance. > > Am 08.02.21 um 06:30 schrieb Devon McCormick: > > This scales the hexagon to have unit area. > > hexagonArea=: 3 : '3*y*(-:y)*%:3' NB. Where y is side length > > sideOfUnitHexagon=: 0.6204032394013997 > > hexagonArea sideOfUnitHexagon > > 1 > > ]r=. sideOfUnitHexagon*-:%:3 > > 0.537285 > > 'title Regular Hexagons Centered at Origin;type line;pensize 2; aspect > > 0.866' plot (],.{."1) (r,1)*"(0 1) (_1^1r3)^i.6 > > > > See > > > https://code.jsoftware.com/wiki/NYCJUG/2021-02-09#Corners_of_Unit_Hexagon_Centered_at_Origin > > for a diagram illustrating why we use the square root of 3. > > > > On Sun, Feb 7, 2021 at 4:00 PM Hauke Rehr <[email protected]> > wrote: > > > >> I wonder about that scaling factor in > >> > >> */ , 5e_7 > | hexCorners - 0.537285 * +. (_1^1r3)^i.6 > >> > >> Is there anything special about it? > >> > >> > >> Am 07.02.21 um 21:28 schrieb Devon McCormick: > >>> I'm trying to draw a unit hexagon centered at the origin with the > >>> horizontal sides parallel to the X-axis. I've come up with these > >>> co-ordinates for the corners but when I plot them, the drawing looks a > >>> little too wide: > >>> > >>> hexCorners=. _2]\,0.537285 0 0.268642 0.465302 _0.268642 0.465302 > >>> _0.537285 0 _0.268642 _0.465302 0.268642 _0.465302 > >>> 'title Regular Unit Hexagon Centered at Origin;type line;pensize 2' > >> plot > >>> (],{.) j./"1 hexCorners > >>> > >>> I can use my paint program to distort a picture of this plot until it > >> looks > >>> like it has a square aspect ratio (roughly, width height * 0.92 1.06) > but > >>> how can I plot this with the correct aspect ratio in the first place? > >>> > >> > >> -- > >> ---------------------- > >> mail written using NEO > >> neo-layout.org > >> ---------------------------------------------------------------------- > >> For information about J forums see http://www.jsoftware.com/forums.htm > >> > > > > > > -- > ---------------------- > mail written using NEO > neo-layout.org > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Devon McCormick, CFA Quantitative Consultant ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
