Пример #1
0
 /// <inheritdoc/>
 public IPlanarGeometry Intersection(Point2 other)
 {
     return(Intersects(other) ? (IPlanarGeometry)other : null);
 }
Пример #2
0
 /// <summary>
 /// Constructs a line with infinite length passing though both points <paramref name="a"/> and <paramref name="b"/>.
 /// </summary>
 /// <param name="a">A point.</param>
 /// <param name="b">A point.</param>
 public Line2(Point2 a, Point2 b)
     : this(a, b - a)
 {
 }
Пример #3
0
 /// <summary>
 /// Calculates the distance between this multi-line string and the point, <paramref name="p"/>.
 /// </summary>
 /// <param name="p">The point to calculate distance to.</param>
 /// <returns>The distance.</returns>
 public double Distance(Point2 p)
 {
     Contract.Ensures(Contract.Result <double>() >= 0.0 || Contract.Result <double>().Equals(Double.NaN));
     return(Math.Sqrt(DistanceSquared(p)));
 }
Пример #4
0
 /// <summary>
 /// Constructs a line with infinite length passing though <paramref name="p"/> with direction <paramref name="d"/>.
 /// </summary>
 /// <param name="p">A point on the line.</param>
 /// <param name="d">The direction of the line.</param>
 public Line2(Point2 p, Vector2 d)
 {
     P         = p;
     Direction = d;
 }