private void buildSegmentLengths() {
		segmentLengths = new double[this.segments.length - 1];
		segmentLengthsSum = new double[this.segments.length - 1];

		for( int i = 0, n = segments.length - 1; i < n; i++ ) {
			Point2D start = segments[i];
			Point2D end = segments[i + 1];

			double length = start.distance( end );
			segmentLengths[i] = length;
		}

		for( int i = 1, n = segments.length - 1; i < n; i++ ) {
			segmentLengthsSum[i] = segmentLengthsSum[i - 1] + segmentLengths[i - 1];
		}
		for( double length : segmentLengths ) {
			totalLength += length;
		}
	}