public EquilateralTriangle(decimal width, decimal height, _CalcTypes calc) { switch (calc) { case _CalcTypes.AreaCalc: Area = Math.Round(CalculateArea(width, height), 3, MidpointRounding.AwayFromZero); break; case _CalcTypes.PerimeterCalc: Perimeter = Math.Round(CalculatePerimeter(width), 3, MidpointRounding.AwayFromZero); break; default: break; } }
public Square(decimal length, _CalcTypes calc) { switch (calc) { case _CalcTypes.AreaCalc: Area = CalculateArea(length); break; case _CalcTypes.PerimeterCalc: Perimeter = CalculatePerimeter(length); break; default: break; } }
public Ellipse(decimal longRadius, decimal shortRadius, _CalcTypes calc) { switch (calc) { case _CalcTypes.AreaCalc: Area = Math.Round(CalculateArea(longRadius, shortRadius), 3, MidpointRounding.AwayFromZero); break; case _CalcTypes.PerimeterCalc: Perimeter = Math.Round(CalculatePerimeter(longRadius, shortRadius), 3, MidpointRounding.AwayFromZero); break; default: //Perhaps log an issue here? break; } }
public Rectangle(decimal width, decimal height, _CalcTypes calc) { switch (calc) { case _CalcTypes.AreaCalc: Area = CalculateArea(width, height); break; case _CalcTypes.PerimeterCalc: Perimeter = CalculatePerimeter(width, height); break; default: //Maybe add an issue logger? break; } }
public Cuboid(decimal height, decimal width, decimal length, _CalcTypes calc) { switch (calc) { case _CalcTypes.AreaCalc: SurfaceArea = CalculateArea(height, width, length); break; case _CalcTypes.VolumeCalc: Volume = CalculateVolume(height, width, length); break; default: //Perhaps log an issue here? break; } }
public Sphere(decimal radius, _CalcTypes calc) { switch (calc) { case _CalcTypes.AreaCalc: SurfaceArea = Math.Round(CalculateArea(radius), 3, MidpointRounding.AwayFromZero); break; case _CalcTypes.VolumeCalc: Volume = Math.Round(CalculateVolume(radius), 3, MidpointRounding.AwayFromZero); break; default: //Perhaps log an issue here? break; } }
public Prism(decimal height, decimal width, decimal length, _CalcTypes calc, _3DBases shapeBase) { switch (calc) { case _CalcTypes.AreaCalc: SurfaceArea = Math.Round(CalculateArea(height, width, length, shapeBase), 3, MidpointRounding.AwayFromZero); break; case _CalcTypes.VolumeCalc: Volume = Math.Round(CalculateVolume(height, width, length, shapeBase), 3, MidpointRounding.AwayFromZero); break; default: //Perhaps log an issue here? break; } }
public ActionResult <Cylinder> Cylinder(decimal radius, decimal length, _CalcTypes calc) { //calc is used for an Enum to tell the Circle constructor what method to use return(new Cylinder(radius, length, calc)); }
public ActionResult <Cuboid> Cuboid(decimal height, decimal length, decimal width, _CalcTypes calc) { //calc is used for an Enum to tell the constructor what method to use return(new Cuboid(height, width, length, calc)); }
public ActionResult <Cube> Cube(decimal length, _CalcTypes calc) { //calc is used for an Enum to tell the constructor what method to use return(new Cube(length, calc)); }
public ActionResult <Cone> Cone(decimal radius, decimal height, _CalcTypes calc) { //calc is used for an Enum to tell the constructor what method to use return(new Cone(radius, height, calc)); }
public ActionResult <Right_AngledTriangle> Right_AngledTriangle(decimal width, decimal height, _CalcTypes calc) { //calc is used for an Enum to tell the constructor what method to use return(new Right_AngledTriangle(width, height, calc)); }
public ActionResult <Rectangle> Rectangle(decimal length, decimal width, _CalcTypes calc) { //calc is used for an Enum to tell the constructor what method to use return(new Rectangle(length, width, calc)); }
public ActionResult <Ellipse> Ellipse(decimal longRadius, decimal shortRadius, _CalcTypes calc) { //calc is used for an Enum to tell the constructor what method to use return(new Ellipse(longRadius, shortRadius, calc)); }
public ActionResult <Circle> Circle(decimal radius, _CalcTypes calc) { //calc is used for an Enum to tell the constructor what method to use return(new Circle(radius, calc)); }
public ActionResult <Pyramid> Pyramid(decimal height, decimal width, decimal length, _CalcTypes calc, _3DBases b) { //calc is used for an Enum to tell the Circle constructor what method to use //b is used to tell whether the shape has a triangular or square base return(new Pyramid(height, width, length, calc, b)); }