Rectangle class
Represent a rectangle in 2D space.
- Inheritance
-
- Object
- Geometry
- PlaneGeometry
- Rectangle
Constructors
- Rectangle(num length, num width)
- Constructs a Rectangle with a given length and width.
- Rectangle.from({num? length, num? width, num? diagonal, num? perimeter, num? area})
- Named constructor to create a Rectangle from various parameters.
- Rectangle.fromAreaAndAspectRatio({required double area, required double aspectRatio})
-
Creates a rectangle from area and aspect ratio.
factory
Properties
Methods
-
anglesBetweenDiagonals(
) → ({Angle a, Angle b}) - Calculates the angles between the diagonals of the rectangle.
-
area(
) → num -
Calculates the area of the 2D geometric shape.
override
-
aspectRatio(
) → double - Calculates the aspect ratio of the rectangle.
-
diagonal(
) → double - Calculates the diagonal length of the rectangle.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
perimeter(
) → num -
Calculates the perimeter of the 2D geometric shape.
override
-
perimeterRatio(
) → double - Calculates the ratio of the perimeter to twice the diagonal of the rectangle.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited