Distributing elements
From TaskDepender
(→Design) |
(→Design) |
||
Line 37: | Line 37: | ||
with: | with: | ||
+ | <math>s_{1} = x_{min}</math><br> | ||
+ | and<br> | ||
<math>S = \displaystyle\frac{x_{max}-x_{min}-W}{N-1}</math> | <math>S = \displaystyle\frac{x_{max}-x_{min}-W}{N-1}</math> | ||
Since the algorithm assumes elements that the elements are ordered by position of the left edges, this additional step must be performed before running the described algorithm. | Since the algorithm assumes elements that the elements are ordered by position of the left edges, this additional step must be performed before running the described algorithm. | ||
+ | |||
+ | The same algorithm can be used for distributing the elements vertically. In that case the equations are: | ||
+ | |||
+ | <math>y_i = s_{i-1} + h_{i-1} + S</math> | ||
+ | |||
+ | with: | ||
+ | |||
+ | <math>s_{1} = y_{min}</math>,<br> | ||
+ | <math>S = \displaystyle\frac{x_{max}-x_{min}-H}{N-1}</math> | ||
+ | and<br> | ||
+ | <math>H = \displaystyle\sum_{i=1}^N h_i</math> | ||
== Implementation == | == Implementation == |