Weight of the edge from from to to. Equals cellCostOf(to) * stepLength, where stepLength is 1.0 for orthogonal steps and √2 for diagonal steps. The caller is responsible for ensuring to is a neighbor of from under the movement rule; this function does not validate that.