Quadrilateral class
A quadrilateral defined by four vertices in order.
Provides classification checks for common quadrilateral types: parallelogram, rhombus, trapezoid, kite, and rectangle.
- Implemented types
Constructors
- Quadrilateral(Point a, Point b, Point c, Point d)
-
Creates a quadrilateral from four vertices in order.
const
Properties
- a → Point
-
Vertex A.
final
- AB → Line
-
Side from a to b
no setter
- area → double
-
Area of this quadrilateral using the shoelace formula.
no setteroverride
- b → Point
-
Vertex B.
final
- BC → Line
-
Side from b to c
no setter
- c → Point
-
Vertex C.
final
- CD → Line
-
Side from c to d
no setter
- center → Point
-
Center point (average of vertices)
no setter
- d → Point
-
Vertex D.
final
- DA → Line
-
Side from d to a
no setter
- diagonalAC → Line
-
Diagonal from a to c
no setter
- diagonalBD → Line
-
Diagonal from b to d
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- isConvex → bool
-
Whether this quadrilateral is convex
no setter
- isKite → bool
-
Whether this is a kite
no setter
- isParallelogram → bool
-
Whether this is a parallelogram
no setter
- isRectangle → bool
-
Whether this is a rectangle
no setter
- isRhombus → bool
-
Whether this is a rhombus
no setter
- isSquare → bool
-
Whether this is a square
no setter
- isTrapezoid → bool
-
Whether this is a trapezoid (trapezium)
no setter
- perimeter → double
-
Perimeter of this quadrilateral (sum of all four side lengths).
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sides
→ List<
Line> -
The four sides in order
no setter
-
vertices
→ List<
Point> -
The four vertices in order
no setter
Methods
-
contains(
Point p) → bool - Check if a point is inside this quadrilateral
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
rotate(
double deg) → Quadrilateral -
Rotate all vertices by
degdegrees around the origin.override -
scale(
double value) → Quadrilateral -
Scale all vertices by
value.override -
toString(
) → String -
A string representation of this object.
override
-
translate(
{double x = 0, double y = 0}) → Quadrilateral -
Translate all vertices by
xhorizontally andyvertically.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override