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

    Function getHeightFromAR

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

      Parameters

      • height: number

        The height of the element.

      • ar: number

        The aspect ratio (width / height).

      Returns number

      The calculated width, rounded to the nearest whole number.

      const width = getHeightFromAR(1080, 1.7777777778);
      console.log(width); // Output: 1920