def expected_mag(RAW_IMU, ATTITUDE, inclination, declination):
    '''return expected mag vector'''
    m_body = Vector3(RAW_IMU.xmag, RAW_IMU.ymag, RAW_IMU.zmag)
    field_strength = m_body.length()

    m = rotation(ATTITUDE)

    r = Matrix3()
    r.from_euler(0, -radians(inclination), radians(declination))
    m_earth = r * Vector3(field_strength, 0, 0)

    return m.transposed() * m_earth
def expected_mag ( RAW_IMU , ATTITUDE , inclination , declination ) : m_body = Vector3 ( RAW_IMU . xmag , RAW_IMU . ymag , RAW_IMU . zmag ) field_strength = m_body . length ( ) m = rotation ( ATTITUDE ) r = Matrix3 ( ) r . from_euler ( 0 , - radians ( inclination ) , radians ( declination ) ) m_earth = r * Vector3 ( field_strength , 0 , 0 ) return m . transposed ( ) * m_earth
return expected mag vector