private GeoSegment getQQLineSegment() { SummaryStatistics stats = new SummaryStatistics(); for (int i = 0; i < sortedData.length; i++) { stats.addValue(sortedData[i]); } double sd = stats.getStandardDeviation(); double mean = stats.getMean(); double min = stats.getMin(); double max = stats.getMax(); // qq line: y = (1/sd)x - mean/sd GeoPoint startPoint = new GeoPoint(cons); startPoint.setCoords(min, (min / sd) - mean / sd, 1.0); GeoPoint endPoint = new GeoPoint(cons); endPoint.setCoords(max, (max / sd) - mean / sd, 1.0); GeoSegment seg = new GeoSegment(cons, startPoint, endPoint); seg.calcLength(); return seg; }