Area.fromTriangle constructor

Area.fromTriangle(
  1. Length base,
  2. Length height
)

Returns a new Area object from the base and height of a triangle.

Implementation

factory Area.fromTriangle(Length base, Length height) {
  return Area.fromSquareCentimetres(
      base.inCentimetres * height.inCentimetres / 2);
}