Shadow length Implimentation

If you want to avoid the shadow from one panel falling on adjacent panels then I think you would need to impose a constraint on the sun tracking that stopped it moving the panel into the region where the shadow would overlap. Obviously this region would depend on where the sun was. The trig to calculate that would be conceptually easy enough to work out but quite tedious to work through. I'm too lazy to do it for you. I didn't follow the links you posted - do they give you the formula to calculate the orientation at which overlap occurs from the sun position and panel size+spacing?