void test_enu_to_ecef_to_enu( void ) { struct EcefCoor_f ref_coor = { 4624497.0 , 116475.0, 4376563.0}; printf("ecef0 : (%.02f,%.02f,%.02f)\n", ref_coor.x, ref_coor.y, ref_coor.z); struct LtpDef_f ltp_def; ltp_def_from_ecef_f(<p_def, &ref_coor); struct EcefCoor_f ecef_p1 = ref_coor; struct EnuCoor_f enu_p1; enu_of_ecef_point_f(&enu_p1, <p_def, &ecef_p1); printf("ecef to enu : (%f,%f,%f) -> (%f,%f,%f)\n", ecef_p1.x, ecef_p1.y, ecef_p1.z, enu_p1.x, enu_p1.y, enu_p1.z ); #if 0 struct EcefCoor_f ecef_p2; ecef_of_enu_point_f(&ecef_p2, <p_def, &enu_p1); printf("enu to ecef : (%f,%f,%f) -> (%f,%f,%f)\n", enu_p1.x, enu_p1.y, enu_p1.z, ecef_p2.x, ecef_p2.y, ecef_p2.z); printf("\n"); #endif }
void ecef_of_ned_point_f(struct EcefCoor_f* ecef, struct LtpDef_f* def, struct NedCoor_f* ned) { struct EnuCoor_f enu; ENU_OF_TO_NED(enu, *ned); ecef_of_enu_point_f(ecef, def, &enu); }