public LDLine unitVector() { if (this.length() == 0) { return(this); } LDLine unit = new LDLine(this); unit.setP2(new LDPoint(unit.pt1.x() + unit.dx() / this.length(), unit.pt1.y() + unit.dy() / this.length())); return(unit); }
public LDLine unitVector() { if (this.length() == 0) { return this; } LDLine unit = new LDLine(this); unit.setP2(new LDPoint(unit.pt1.x() + unit.dx() / this.length(), unit.pt1.y() + unit.dy() / this.length())); return unit; }