import math


def _angle_between_vectors(vector_1, vector_2):
    """ Calculates the angle in between the 2 rank vectors.
    Uses dot product to calculate the cosine of the angle, then math.acos to
    convert into angle.

    Args:
        vector_1, vector_2: Type-Dict
            The Angle is calculated in between these 2 vectors.
            The keys of the vector are the axis of the vector,
            and values are the length in that axis.
    Returns:
        The angle in between the 2 vectors in degree.
    """
    cross_product = 0
    magnitude1 = 0
    magnitude2 = 0

    for x in vector_1.keys():
        cross_product = cross_product + vector_1[x] * vector_2[x]
        magnitude1 = magnitude1 + vector_1[x] * vector_1[x]
        magnitude2 = magnitude2 + vector_2[x] * vector_2[x]

    cosine_angle = cross_product / (math.sqrt(magnitude1 * magnitude2))

    angle = math.acos(cosine_angle)

    # angle in degrees
    angle = angle * 180 / math.pi

    return angle