line.setLength(length)

Scale the line so that it has the requested length. The start point of the line is preserved.