Exemple #1
0
 public Ellipse(Point2D focus1, Point2D focus2, double minorAxis = 0, double majorAxis = 0)
 {
     this.Focus1 = focus1;
     this.Focus2 = focus2;
     this.MinorAxis = minorAxis;
     this.MajorAxis = majorAxis;
 }
        public static double CalculateDistance2D(Point2D a, Point2D b)
        {
            double deltaX = a.XCoordinate - b.XCoordinate;
            double deltaY = a.YCoordinate - b.YCoordinate;

            double distance = Math.Sqrt(deltaX * deltaX + deltaY * deltaY);

            return distance;
        }
Exemple #3
0
 public Rectangle(Point2D location, double width = 0, double height = 0)
 {
     this.Location = location;
     this.Width = width;
     this.Height = height;
 }
Exemple #4
0
 public Circle(Point2D center, double radius = 0)
 {
     this.Center = center;
     this.Radius = radius;
 }
Exemple #5
0
 public Square(Point2D location, double sideLength = 0)
 {
     this.Location = location;
     this.SideLength = sideLength;
 }