private static float ApplyDash(Path dashedPath, Point2D segStart, Point2D segEnd, Point2D dashTo, bool isGap) { float remainingDist = 0; if (!LiesOnSegment(segStart, segEnd, dashTo)) { remainingDist = (float) dashTo.Distance(segEnd); dashTo = segEnd; } if (isGap) { dashedPath.MoveTo((float) dashTo.GetX(), (float) dashTo.GetY()); } else { dashedPath.LineTo((float) dashTo.GetX(), (float) dashTo.GetY()); } return remainingDist; }
private static double GetVectorEuclideanNorm(Point2D vector) { return vector.Distance(0, 0); }