Exemple #1
0
        public static List <Hex> HexLinedraw(Hex a, Hex b)
        {
            var n       = a.Distance(b);
            var aNudge  = new FractionalHex(a.Q + 0.000001, a.R + 0.000001, a.S - 0.000002);
            var bNudge  = new FractionalHex(b.Q + 0.000001, b.R + 0.000001, b.S - 0.000002);
            var results = new List <Hex>();
            var step    = 1.0 / Math.Max(n, 1);

            for (var i = 0; i <= n; i++)
            {
                results.Add(aNudge.HexLerp(bNudge, step * i).HexRound());
            }

            return(results);
        }
Exemple #2
0
 public FractionalHex HexLerp(FractionalHex b, double t)
 {
     return(new FractionalHex(Q * (1.0 - t) + b.Q * t, R * (1.0 - t) + b.R * t, S * (1.0 - t) + b.S * t));
 }