Exemplo n.º 1
0
 public Segment2D(Point2D basePoint, Direction2D direction, Distance length)
 {
     if (length == ZeroDistance)
     {
         throw new Exception("Segment length must be greater than zero.");
     }
     BasePoint = basePoint;
     EndPoint  = basePoint + direction.ToVector(length);
     Length    = length.AbsoluteValue();
 }
Exemplo n.º 2
0
 /// <summary>
 /// Primary Constructor
 /// </summary>
 public Vector([NotNull] Point basePoint, Direction direction, Distance magnitude)
 {
     BasePoint = basePoint;
     Magnitude = magnitude.AbsoluteValue();
     Direction = magnitude.IsPositive() ? direction : direction.Reverse();
 }