title: divide (split) the line into segments of arbitrary length each. (short at begining wide at the end)
body: <p>Assume there is a line <code>(1, 30)</code> (float x = 30)
  I need to split it into segments, each next segment should be wider than previous one, and the last segment should be X times wider than first one.</p>
  
  <p>I have idea first split line into equal parts and than increase next and decrease previous until two conditions reached: 
  - first segment is shorter than last X times
  - each segment (except first) is wider than previous for the same multiplier</p>
  
  <pre><code>    //input:
      int lineDimension = 30;
      int numberOfSegments = 5;
      int step = 1;
  
      float[] splitLineIntoSegments(float lineDimension, int numberOfSegments, float differenceBetweenFirstAndLastSegmentMultiplicator, float step) {
        float[] result = new float[numberOfSegments];
        //first split into equal segments
        for (int i = 0; i &lt; numberOfSegments; i++) {
          result[i] = lineDimension / numberOfSegments;
        }
        //increase each next value untill difference reached
        do {
          for (int ii = 0; ii &lt; numberOfSegments; ii++) {
            if (result[ii]-step&lt;=0)
              return result;
              if (ii&gt;numberOfSegments/2){
                result[ii] += step;
              }
              else result[ii] -= step;
          }
        }
        while ((float)result[numberOfSegments] / (float)result[0] &gt; differenceBetweenFirstAndLastSegmentMultiplicator);
  
        return result;
      }
  
  float [] res = splitLineIntoSegments(lineDimension,numberOfSegments,2,step);
  
  </code></pre>
  
  <p>as the result it should be 4,5,6,7,8</p>
  
  <p>There is a better way to do it ?</p>