import math


def distance(first_point: tuple, second_point: tuple) -> float:
    """
    Returns a number - distance between two points in meters.
    >>> distance((49.83826, 24.02324), (45.91234, 27.54962))
    509514.6569293797
    """
    earth_radius = 6371e3
    latitude_1 = first_point[0] * math.pi / 180
    latitude_2 = second_point[0] * math.pi / 180
    longitude_1 = first_point[1] * math.pi / 180
    longitude_2 = second_point[1] * math.pi / 180
    latitude_difference = latitude_2 - latitude_1
    longitude_difference = longitude_2 - longitude_1
    haversine_a = (math.sin(latitude_difference / 2) ** 2) + math.cos(latitude_1) * \
        math.cos(latitude_2) * (math.sin(longitude_difference / 2) ** 2)
    haversine_c = 2 * math.atan2(math.sqrt(haversine_a), math.sqrt(1 - haversine_a))
    haversine_distance = earth_radius * haversine_c
    return haversine_distance