public static Point3d getBarycentre(Point3d startPoint, Point3d endPoint, double distance) {
double maxDistance = startPoint.distance(endPoint);
double distanceToUse = computeDistanceToUse(maxDistance, distance);
double ratio = distanceToUse / maxDistance;
Point3d result = new Point3d();
result.interpolate(startPoint, endPoint, ratio);
return result;
}
/**
* Bounds the given distance between 0 and maxDistance