Example #1
0
        public PVector ClosesetPoint(PVector p)
        {
            var a = FullVector.Copy();

            a.RotateDegrees(90);
            a.Add(p);
            var newLine = new PLine(p, a);

            return(Intersection(newLine));
        }
Example #2
0
 public PVector Intersection(PLine b)
 {
     if (M == b.M)
     {
         return(null);
     }
     else
     {
         var x = (b.B - B) / (M - b.M);
         var y = (M * b.B - b.M * B) / (M - b.M);
         return(new PVector(x, y));
     }
 }