コード例 #1
0
ファイル: Vector2d.cs プロジェクト: Paramdigma/Core
 /// <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
ファイル: Sphere.cs プロジェクト: Paramdigma/Core
 /// <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);