/** * Returns the length of the path used by this PathLength object. * @return The length of the path. */ public float lengthOfPath() { if (!initialised) { initialise(); } return pathLength; }
/** * Returns the length of the path used by this PathLength object. * @return The length of the path. */ public float lengthOfPath() { if (!initialised) { initialise(); } return pathLength; }
/** * Returns the length of the path used by this PathLength object. * @return The length of the path. */ public float lengthOfPath() { if (!initialised) { initialise(); } return pathLength; }
/** * Returns the number of segments in the path. */ public int getNumberOfSegments() { if (!initialised) { initialise(); } return segmentIndexes.length; }
/** * Returns the number of segments in the path. */ public int getNumberOfSegments() { if (!initialised) { initialise(); } return segmentIndexes.length; }
/** * Returns the number of segments in the path. */ public int getNumberOfSegments() { if (!initialised) { initialise(); } return segmentIndexes.length; }
/** * Returns the length at the start of the segment given by the specified * index. */ public float getLengthAtSegment(int index) { if (!initialised) { initialise(); } if (index <= 0) { return 0; } if (index >= segmentIndexes.length) { return pathLength; } PathSegment seg = (PathSegment) segments.get(segmentIndexes[index]); return seg.getLength(); }
/** * Returns the length at the start of the segment given by the specified * index. */ public float getLengthAtSegment(int index) { if (!initialised) { initialise(); } if (index <= 0) { return 0; } if (index >= segmentIndexes.length) { return pathLength; } PathSegment seg = (PathSegment) segments.get(segmentIndexes[index]); return seg.getLength(); }
/** * Returns the length at the start of the segment given by the specified * index. */ public float getLengthAtSegment(int index) { if (!initialised) { initialise(); } if (index <= 0) { return 0; } if (index >= segmentIndexes.length) { return pathLength; } PathSegment seg = (PathSegment) segments.get(segmentIndexes[index]); return seg.getLength(); }
/** * Returns the point that is the given proportion along the path segment * given by the specified index. */ public Point2D pointAtLength(int index, float proportion) { if (!initialised) { initialise(); } if (index < 0 || index >= segmentIndexes.length) { return null; } PathSegment seg = (PathSegment) segments.get(segmentIndexes[index]); float start = seg.getLength(); float end; if (index == segmentIndexes.length - 1) { end = pathLength; } else { seg = (PathSegment) segments.get(segmentIndexes[index + 1]); end = seg.getLength(); } return pointAtLength(start + (end - start) * proportion); }
/** * Returns the point that is the given proportion along the path segment * given by the specified index. */ public Point2D pointAtLength(int index, float proportion) { if (!initialised) { initialise(); } if (index < 0 || index >= segmentIndexes.length) { return null; } PathSegment seg = (PathSegment) segments.get(segmentIndexes[index]); float start = seg.getLength(); float end; if (index == segmentIndexes.length - 1) { end = pathLength; } else { seg = (PathSegment) segments.get(segmentIndexes[index + 1]); end = seg.getLength(); } return pointAtLength(start + (end - start) * proportion); }
/** * Returns the slope of the path at the specified length. * @param index The segment number * @param proportion The proportion along the given segment * @return the angle in radians, in the range [-{@link Math#PI}, * {@link Math#PI}]. */ public float angleAtLength(int index, float proportion) { if (!initialised) { initialise(); } if (index < 0 || index >= segmentIndexes.length) { return 0f; } PathSegment seg = (PathSegment) segments.get(segmentIndexes[index]); float start = seg.getLength(); float end; if (index == segmentIndexes.length - 1) { end = pathLength; } else { seg = (PathSegment) segments.get(segmentIndexes[index + 1]); end = seg.getLength(); } return angleAtLength(start + (end - start) * proportion); }
/** * Returns the slope of the path at the specified length. * @param index The segment number * @param proportion The proportion along the given segment * @return the angle in radians, in the range [-{@link Math#PI}, * {@link Math#PI}]. */ public float angleAtLength(int index, float proportion) { if (!initialised) { initialise(); } if (index < 0 || index >= segmentIndexes.length) { return 0f; } PathSegment seg = (PathSegment) segments.get(segmentIndexes[index]); float start = seg.getLength(); float end; if (index == segmentIndexes.length - 1) { end = pathLength; } else { seg = (PathSegment) segments.get(segmentIndexes[index + 1]); end = seg.getLength(); } return angleAtLength(start + (end - start) * proportion); }
/** * Returns the point that is the given proportion along the path segment * given by the specified index. */ public Point2D pointAtLength(int index, float proportion) { if (!initialised) { initialise(); } if (index < 0 || index >= segmentIndexes.length) { return null; } PathSegment seg = (PathSegment) segments.get(segmentIndexes[index]); float start = seg.getLength(); float end; if (index == segmentIndexes.length - 1) { end = pathLength; } else { seg = (PathSegment) segments.get(segmentIndexes[index + 1]); end = seg.getLength(); } return pointAtLength(start + (end - start) * proportion); }
/** * Returns the slope of the path at the specified length. * @param index The segment number * @param proportion The proportion along the given segment * @return the angle in radians, in the range [-{@link Math#PI}, * {@link Math#PI}]. */ public float angleAtLength(int index, float proportion) { if (!initialised) { initialise(); } if (index < 0 || index >= segmentIndexes.length) { return 0f; } PathSegment seg = (PathSegment) segments.get(segmentIndexes[index]); float start = seg.getLength(); float end; if (index == segmentIndexes.length - 1) { end = pathLength; } else { seg = (PathSegment) segments.get(segmentIndexes[index + 1]); end = seg.getLength(); } return angleAtLength(start + (end - start) * proportion); }