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(); }
/// <summary> /// Primary Constructor /// </summary> public Vector([NotNull] Point basePoint, Direction direction, Distance magnitude) { BasePoint = basePoint; Magnitude = magnitude.AbsoluteValue(); Direction = magnitude.IsPositive() ? direction : direction.Reverse(); }