Пример #1
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="Vector2d" /> class from a point.
 /// </summary>
 /// <param name="point">Point to convert.</param>
 /// <returns>New vector with same values.</returns>
 public Vector2d(Point2d point)
     : this(point.X, point.Y)
 {
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Line2d"/> class.
 /// </summary>
 /// <param name="startPoint">Start point.</param>
 /// <param name="direction">Direction (length of vector will be disregarded).</param>
 /// <param name="length">Desired length of the line.</param>
 /// <returns>New 2d line instance.</returns>
 public Line2d(Point2d startPoint, Vector2d direction, double length)
     : this(startPoint, direction.Unit() * length)
 {
 }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Line2d"/> class.
 /// </summary>
 /// <param name="startPoint">The start point of the line.</param>
 /// <param name="direction">Direction. The length of the vector will determine the end point.</param>
 /// <returns>New 2d line instance.</returns>
 public Line2d(Point2d startPoint, Vector2d direction)
     : this(startPoint, startPoint + direction)
 {
 }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Line2d"/> class.
 /// </summary>
 /// <param name="startPoint">Start point of the line.</param>
 /// <param name="endPoint">End point of the line.</param>
 public Line2d(Point2d startPoint, Point2d endPoint)
 {
     this.StartPoint = startPoint;
     this.EndPoint   = endPoint;
     this.Domain     = new Interval(0, Length);
 }
Пример #5
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="Point3d" /> class from a 2-dimensional point.
 /// </summary>
 /// <param name="point">2d point to convert.</param>
 /// <returns><see cref="Point3d" />.</returns>
 public Point3d(Point2d point)
     : base(point.X, point.Y, 0)
 {
 }
Пример #6
0
 /// <summary>
 ///     Computes the point at a specified parameter, provided as a <see cref="Point2d" /> instance.
 /// </summary>
 /// <param name="uvPoint"><see cref="Point2d" /> parameter coordinates.</param>
 /// <returns><see cref="Point3d" /> instance of the specified point.</returns>
 public Point3d PointAt(Point2d uvPoint) => this.PointAt(uvPoint.X, uvPoint.Y);