public RectangularPrism(Rectangle rectangle, Distance height) : base(_makePrismFromRectangle(rectangle, height)) { }
private static Polyhedron _makePrismFromRectangle(Rectangle rectangle, Distance height) { var prism = rectangle.Extrude(rectangle.NormalVector * height.ValueInInches); return prism; }
public void Polygon_Rectangle_Constructor() { LineSegment testSegment = new LineSegment(new Vector(Point.Origin, Direction.Left, new Distance(1, Inches))); testSegment = testSegment.Rotate(new Rotation(Line.ZAxis, new Angle(33, Degrees))); Rectangle myRectangle = new Rectangle(testSegment, new Distance(1, Inches)); Area myArea = myRectangle.Area; (myArea == new Area(new SquareInch(), 1)).Should().BeTrue(); myRectangle.IsRectangle().Should().BeTrue(); }