I have a set of dynamically shaped objects, How do I distribute them evenly either Horizontally or Vertically.The objects are surrounded by a bounding box and the objects are placed at x,y as shown.
Can anyone help me in providing the algorithm or pseudo code.
UPDATE: It is clear that, the shapes those stay at extremes (forming a bounded box) are kept constant and the remaining objects inside the space is distributed evenly. I used a word processing application to simulate the above example.
For 2 objects inside,