public static bool SegmentToAboveArc(Segment seg, Arc arcAbove, ref double distance) { bool success = false; distance = double.MaxValue; List <Segment> listArc = arcAbove.Explode(20); foreach (Segment segArc in listArc) { double dist = 0.0f; if (PointToAboveSegment(seg.P0, segArc, ref dist) && dist > 0) { distance = System.Math.Min(distance, dist); success = true; } if (PointToAboveSegment(seg.P1, segArc, ref dist) && dist > 0) { distance = System.Math.Min(distance, dist); success = true; } if (PointToAboveSegment(segArc.P0, seg, ref dist) && dist < 0) { distance = System.Math.Min(distance, -dist); success = true; } if (PointToAboveSegment(segArc.P1, seg, ref dist) && dist < 0) { distance = System.Math.Min(distance, -dist); success = true; } } return(success); }
public static bool PointToAboveArc(Vector2D p, Arc arc, ref double distance) { bool success = false; distance = double.MaxValue; IList<Segment> list = arc.Explode(20); foreach (Segment seg in list) { double dist = 0.0f; if (PointToAboveSegment(p, seg, ref dist) && dist > 0) { distance = System.Math.Min(dist, distance); success = true; } } return success; }
public static bool PointToAboveArc(Vector2D p, Arc arc, ref double distance) { bool success = false; distance = double.MaxValue; IList <Segment> list = arc.Explode(20); foreach (Segment seg in list) { double dist = 0.0f; if (PointToAboveSegment(p, seg, ref dist) && dist > 0) { distance = System.Math.Min(dist, distance); success = true; } } return(success); }
public static bool ArcToAboveArc(Arc arc1, Arc arc2, ref double distance) { bool success = false; distance = double.MaxValue; List <Segment> listArc1 = arc1.Explode(20); List <Segment> listArc2 = arc2.Explode(20); foreach (Segment seg1 in listArc1) { foreach (Segment seg2 in listArc2) { double dist = double.MaxValue; if (VerticalDistance.SegmentToAboveSegment(seg1, seg2, ref dist) && dist > 0) { distance = System.Math.Min(distance, dist); success = true; } } } return(success); }
public static bool SegmentToAboveArc(Segment seg, Arc arcAbove, ref double distance) { bool success = false; distance = double.MaxValue; List<Segment> listArc = arcAbove.Explode(20); foreach (Segment segArc in listArc) { double dist = 0.0f; if (PointToAboveSegment(seg.P0, segArc, ref dist) && dist > 0) { distance = System.Math.Min(distance, dist); success = true; } if (PointToAboveSegment(seg.P1, segArc, ref dist) && dist > 0) { distance = System.Math.Min(distance, dist); success = true; } if (PointToAboveSegment(segArc.P0, seg, ref dist) && dist < 0) { distance = System.Math.Min(distance, -dist); success = true; } if (PointToAboveSegment(segArc.P1, seg, ref dist) && dist < 0) { distance = System.Math.Min(distance, -dist); success = true; } } return success; }
public static bool ArcToAboveArc(Arc arc1, Arc arc2, ref double distance) { bool success = false; distance = double.MaxValue; List<Segment> listArc1 = arc1.Explode(20); List<Segment> listArc2 = arc2.Explode(20); foreach (Segment seg1 in listArc1) foreach (Segment seg2 in listArc2) { double dist = double.MaxValue; if (VerticalDistance.SegmentToAboveSegment(seg1, seg2, ref dist) && dist > 0) { distance = System.Math.Min(distance, dist); success = true; } } return success; }