Distributing elements

From TaskDepender
Jump to: navigation, search
(Design)
(Design)
Line 31: Line 31:
 
[[Image:Distribute_step_3.png]]
 
[[Image:Distribute_step_3.png]]
  
Assuming that the space between two adjacent elements is ''S'', then a certain element ''i'' must be positioned at:
+
Assuming that the space between two adjacent elements is ''S'', then the edge ''x<sub>i</sub>'' of certain element ''i'' must be positioned at:
  
 
<math>x_i = s_{i-1} + w_{i-1} + S</math>
 
<math>x_i = s_{i-1} + w_{i-1} + S</math>
Line 38: Line 38:
 
* <math>s_{1} = x_{min}</math>
 
* <math>s_{1} = x_{min}</math>
 
* <math>S  = \displaystyle\frac{x_{max}-x_{min}-W}{N-1}</math>
 
* <math>S  = \displaystyle\frac{x_{max}-x_{min}-W}{N-1}</math>
 +
 +
This means that the position of the element is given by:
 +
 +
<math>X_i =x_i + w_i/2</math>
 +
  
 
Since the algorithm assumes the elements being ordered by position of the left edges, this additional step must be performed before running the described algorithm.
 
Since the algorithm assumes the elements being ordered by position of the left edges, this additional step must be performed before running the described algorithm.

Revision as of 15:26, 14 November 2011