public double GetLenPtToLine(GPoint tPoint) { CVeObj cVeObj = new CVeObj(this.gpoint_0, tPoint); CVeObj cVeObj2 = new CVeObj(this.gpoint_0, this.gpoint_1); double length = cVeObj2.GetLength(); double result; if (length < 1E-16) { result = cVeObj.GetLength(); } else { double num = Math.Abs(cVeObj2.GetArrowProduct(cVeObj)); result = num / length; } return(result); }