from math import * # Input section d = float(input("Enter the diagonal: ")) a1 = float(input("Enter the aspect ratio, width part: ")) a2 = float(input("Enter the aspect ratio, height part: ")) # Calculations Hp = sqrt(a1**2 + a2**2) sinA = a1 / Hp sinB = a2 / Hp width = (d / sin(pi/2) ) * sinA height = (d / sin(pi/2) ) * sinB # Output section print("Width: ", width) print("Height: ", height) print("Area: ", width*height)