def get_inertia_rectangular(sections):
    """
    Calculates the moment of inertia for a section about the CG.

    Parameters
    ----------
    sections : [[b,h,y,z]_1,...]
        [[b,h,y,z]_1,...] y,z is the centroid
        (x in the direction of the beam, y right, z up)

    Returns
    -------
    interia_parameters : List[Area, Iyy, Izz, Iyz]
        the inertia parameters

    .. seealso:: http://www.webs1.uidaho.edu/mindworks/Machine_Design/Posters/PDF/Moment%20of%20Inertia.pdf
    """
    As = []
    Ax = 0.0
    Ay = 0.0
    for section in sections:
        b, h, x, y = section
        A = b * h
        As.append(A)
        Ax += A * x
        Ay += A * y
    xcg = Ax / A
    ycg = Ay / A
    Axx = 0.0
    Ayy = 0.0
    Axy = 0.0
    for i, section in enumerate(sections):
        b, h, x, y = section
        Axx += As[i] * (x - xcg) ** 2
        Ayy += As[i] * (y - ycg) ** 2
        Axy += As[i] * (x - xcg) * (y - ycg)
    Ixx = Axx / A
    Iyy = Ayy / A
    Ixy = Axy / A
    return A, Ixx, Iyy, Ixy
