/** * Calculates the length of this curve. * <p> * <strong>Important note:</strong><br /> * To calculate the length of a curve it must be interpolated (hence the steps parameter), this method will do this * EVERY time it's called (creating a lot of garbage vectors in the process). This has been done for the sake of * keeping this class simple and the code as readable as possible. Therefore the length should be manually cached * somewhere in your code if it is going to be used repeatedly. * </p> * * @param steps * The number of iterations to perform between control points, the higher this number the more accurate * the returned result will be. * @return The length of this curve. * @see #getApproximateLength(int, int, int) */ public double getApproximateLength(final int steps) { return getApproximateLength(1, getControlPointCount() - 2, steps); }
/** * Calculates the length of this curve. * <p> * <strong>Important note:</strong><br /> * To calculate the length of a curve it must be interpolated (hence the steps parameter), this method will do this * EVERY time it's called (creating a lot of garbage vectors in the process). This has been done for the sake of * keeping this class simple and the code as readable as possible. Therefore the length should be manually cached * somewhere in your code if it is going to be used repeatedly. * </p> * * @param steps * The number of iterations to perform between control points, the higher this number the more accurate * the returned result will be. * @return The length of this curve. * @see #getApproximateLength(int, int, int) */ public double getApproximateLength(final int steps) { return getApproximateLength(1, getControlPointCount() - 2, steps); }