Skip to content

Commit

Permalink
Update Algorithms.cs
Browse files Browse the repository at this point in the history
Bug fix: missed square root in eccentricity calculation
  • Loading branch information
AlekUnderwater authored May 12, 2022
1 parent fb540fd commit 011d20d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CSharp/UCNLNav/Algorithms.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public Ellipsoid(double mjsa, double inverseFlattening)

Flattening = 1 / inverseFlattening;
MinorSemiAxis_m = MajorSemiAxis_m * (1 - Flattening);
Eccentricity = ((MajorSemiAxis_m * MajorSemiAxis_m) - (MinorSemiAxis_m * MinorSemiAxis_m)) / (MajorSemiAxis_m * MajorSemiAxis_m);
EccentricitySq = Eccentricity * Eccentricity;
EccentricitySq = ((MajorSemiAxis_m * MajorSemiAxis_m) - (MinorSemiAxis_m * MinorSemiAxis_m)) / (MajorSemiAxis_m * MajorSemiAxis_m);
Eccentricity = Math.Sqrt(EccentricitySq);
}
}

Expand Down

0 comments on commit 011d20d

Please sign in to comment.