diagonal edge length correction...
implemented by phillip...should be generalized
to a "length" function which can me multiplied to any array