Skip to content

Commit

Permalink
seph2clk: correct recursive expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
ourairquality committed Dec 6, 2024
1 parent aa79681 commit ededbd5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/ephemeris.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,17 +385,14 @@ extern void geph2pos(gtime_t time, const geph_t *geph, double *rs, double *dts,
*-----------------------------------------------------------------------------*/
extern double seph2clk(gtime_t time, const seph_t *seph)
{
double t;
int i;

trace(4,"seph2clk: time=%s sat=%2d\n",time_str(time,3),seph->sat);

t=timediff(time,seph->t0);
double ts = timediff(time, seph->t0), t = ts;

for (i=0;i<2;i++) {
t-=seph->af0+seph->af1*t;
for (int i = 0; i < 2; i++) {
t = ts - (seph->af0 + seph->af1 * t);
}
return seph->af0+seph->af1*t;
return seph->af0 + seph->af1 * t;
}
/* sbas ephemeris to satellite position and clock bias -------------------------
* compute satellite position and clock bias with sbas ephemeris
Expand Down

0 comments on commit ededbd5

Please sign in to comment.