The Ksydex.Figure
namespace provides classes for representing various geometric figures, including triangles and circles.
This package is available on NuGet. You can install it using the following command:
dotnet add package Ksydex.Figure
To use the Ksydex.Figure
namespace in your project, simply add a reference to the Ksydex.Figure
package and use the classes provided:
using Ksydex.Figure;
var triangle = new Triangle(3, 4, 5);
var circle = new Circle(2);
var triangleArea = triangle.Area;
var circleArea = circle.Area;
Represents a geometric figure with an area.
Area
(double): Gets the area of the figure.
Represents a triangle.
Triangle(double a, double b, double c)
: Initializes a new instance of theTriangle
class with the specified side lengths.
Area
(double): Gets the area of the triangle.IsRightAngled
(bool): Gets a value indicating whether the triangle is a right angled triangle.
ArgumentException
: Thrown if any of the side lengths are less than or equal to zero, or if the sum of any two sides is less than or equal to the third side.
Represents a circle.
Circle(double radius)
: Initializes a new instance of theCircle
class with the specified radius.
Area
(double): Gets the area of the circle.
ArgumentException
: Thrown if the radius is less than or equal to zero.
Contributions are welcome! If you find a bug or would like to suggest a new feature, please open an issue or submit a pull request.
This package is licensed under the MIT License.