This repository has been archived on 2026-10-26. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
KNZ_GeoTrackLab/headers/rahcal.h
T
KenanZhu111 aba6c009ab SUPPORT:
1. be able to calculate the sat pos of BDS & Galileo
2. be able to Single postiting by GPS & Galileo
2024-10-14 21:24:01 +08:00

37 lines
877 B
C

#ifndef _RAHCAL_H_
#define _RAHCAL_H_
#include<stdlib.h>
#include<math.h>
#include"public.h"
typedef struct
{
double R;
double A;
double H;
}rahcal;
/* -------------------------------------------------------------------------- */
/// @brief satellite azimuth angle calculation
/// @param rahcal parameter transfer structure
/// @param E east
/// @param N north
/// @param U up
/// @return return structure contain R, A, H members
/* -------------------------------------------------------------------------- */
rahcal RAHCAL(rahcal rahcal,
double E, double N, double U)
{
rahcal.H = atan2(U, sqrt(E * E + N * N));
rahcal.A = atan2(E, U);
if (rahcal.A < 0)
rahcal.A += 2 * PI;
if (rahcal.A > 2 * PI)
rahcal.A -= 2 * PI;
rahcal.R = sqrt(E * E + N * N + U * U);
return rahcal;
}
#endif