Length (it should actually be [interval] thickness rather than length - My bad on the naming) weighted average is calculated like this;
((Prev.MBit * Prev.Length)
+ (Cur.MBit * Cur.Length)
+ (Nex.MBit * Nex.Length))
/(Prev.Length + Cur.Length + Nex.Length)