/** * LineSegment that starts at offset from start and runs for length towards end point * * @param offset offset applied at begin of line * @param length length of the new segment * @return new LineSegment computed */ public LineSegment subSegment(double offset, double length) { Point subSegmentStart = pointAlongLineSegment(offset); Point subSegmentEnd = pointAlongLineSegment(offset + length); return new LineSegment(subSegmentStart, subSegmentEnd); }
/** * Ctor with given start point, a point that defines the direction of the line and a length * * @param start start point * @param direction point that defines the direction (a line from start to direction point) * @param distance how long to move along the line between start and direction */ public LineSegment(Point start, Point direction, double distance) { this.start = start; this.end = new LineSegment(start, direction).pointAlongLineSegment(distance); }
/** * LineSegment that starts at offset from start and runs for length towards end point * * @param offset offset applied at begin of line * @param length length of the new segment * @return new LineSegment computed */ public LineSegment subSegment(double offset, double length) { Point subSegmentStart = pointAlongLineSegment(offset); Point subSegmentEnd = pointAlongLineSegment(offset + length); return new LineSegment(subSegmentStart, subSegmentEnd); }
/** * Ctor with given start point, a point that defines the direction of the line and a length * * @param start start point * @param direction point that defines the direction (a line from start to direction point) * @param distance how long to move along the line between start and direction */ public LineSegment(Point start, Point direction, double distance) { this.start = start; this.end = new LineSegment(start, direction).pointAlongLineSegment(distance); }