Beispiel #1
0
 public Hexagon(SidePair sp0, SidePair sp1, SidePair sp2)
 {
     S0 = sp0.S0;
     S1 = sp0.S1;
     S2 = sp1.S0;
     S3 = sp1.S1;
     S4 = sp2.S0;
     S5 = sp2.S1;
 }
Beispiel #2
0
        private static IEnumerable <SidePair> EnumerateSidePairs()
        {
            var    sidePairs = new List <SidePair>();
            double maxXOrY   = maxSide + Math.Sin(Math.PI / 3);

            for (int s0 = 1; s0 <= maxSide; s0++)
            {
                for (int s1 = 1; s1 <= maxSide; s1++)
                {
                    SidePair sidePair    = new SidePair(s0, s1);
                    Vector   firstVector = sidePair.GetVector(0);
                    if (firstVector.X <= maxXOrY && firstVector.Y <= maxXOrY)
                    {
                        yield return(sidePair);
                    }
                }
            }
        }