Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 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;
 }