static public bool Equals(Hex a, Hex b) { return((a.q == b.q) && (a.r == b.r) && (a.s == b.s)); }
static public int Length(Hex hex) { return((int)((Math.Abs(hex.q) + Math.Abs(hex.r) + Math.Abs(hex.s)) / 2)); }
static public int Distance(Hex a, Hex b) { return(Hex.Length(Hex.Subtract(a, b))); }
static public Hex DiagonalNeighbor(Hex hex, int direction) { return(Hex.Add(hex, Hex.diagonals[direction])); }
static public Hex Neighbor(Hex hex, int direction) { return(Hex.Add(hex, Hex.Direction(direction))); }
static public Hex Scale(Hex a, int k) { return(new Hex(a.q * k, a.r * k, a.s * k)); }
static public Hex Subtract(Hex a, Hex b) { return(new Hex(a.q - b.q, a.r - b.r, a.s - b.s)); }
static public Hex Add(Hex a, Hex b) { return(new Hex(a.q + b.q, a.r + b.r, a.s + b.s)); }