import math


def get_direct_radiation(normal_surface_direct_radiation: float, solar_altitude: float, solar_azimuth: float,
                         surface_tilt_angle: float, surface_azimuth: float) -> float:
    """
    傾斜面の直達日射量を求める関数

    :param normal_surface_direct_radiation: 法線面直達日射量, W/m2
    :param solar_altitude:                  太陽高度角, degree
    :param solar_azimuth:                   太陽方位角, degree
    :param surface_tilt_angle:              傾斜面傾斜角, degree
    :param surface_azimuth:                 傾斜面方位角, degree
    :return: 傾斜面直達日射量, W/m2
    """

    # 傾斜面に対する太陽光線の入射角, degree
    sunlight_incidence_angle\
        = math.sin(math.radians(solar_altitude)) * math.cos(math.radians(surface_tilt_angle))\
          + math.cos(math.radians(solar_altitude)) * math.sin(math.radians(surface_tilt_angle))\
          * math.cos(math.radians(solar_azimuth - surface_azimuth))

    return normal_surface_direct_radiation * sunlight_incidence_angle