@pathmaker-digital/pmd-utilities - v2.2.6
    Preparing search index...

    Function getWidthFromAR

    • Calculates the height of an element from its width and aspect ratio.

      Parameters

      • width: number

        The width of the element.

      • ar: number

        The aspect ratio (width / height).

      Returns number

      The calculated height, rounded to the nearest whole number.

      const height = getWidthFromAR(1920, 1.7777777778);
      console.log(height); // Output: 1080