Example #1
0
 // find diagonal 
 public static double Diagonal(Rectangle r)
 {
     double width = r.Width + Math.Abs(r.Point.Coords[0]);
     double length = r.Length + Math.Abs(r.Point.Coords[1]);
     return Math.Sqrt(width * width + length * length);
 }
Example #2
0
 // copy constructor
 public Rectangle(Rectangle newRectangle)
     : this(newRectangle.Length, newRectangle.Width, newRectangle.Point)
 {
 }
Example #3
0
 // find area 
 public static double Area(Rectangle r)
 {
     double width = r.Width + Math.Abs(r.Point.Coords[0]);
     double length = r.Length + Math.Abs(r.Point.Coords[1]);
     return width * length;
 }