Trinity-SpaceData / conjunction /nasa_cara /DistributedMatlab /Utils /OrbitTransformations /Mean2EccAnomaly.m
Download conjunction/nasa_cara/DistributedMatlab/Utils/OrbitTransformations/Mean2EccAnomaly.m from STAR-future/Trinity-SpaceData: direct link, hf CLI and curl.
- Browser
- Download file 667 Bytes
-
https://huggingface.co/datasets/STAR-future/Trinity-SpaceData/resolve/main/conjunction/nasa_cara/DistributedMatlab/Utils/OrbitTransformations/Mean2EccAnomaly.m
- Command line
-
hf download hf://datasets/STAR-future/Trinity-SpaceData/conjunction/nasa_cara/DistributedMatlab/Utils/OrbitTransformations/Mean2EccAnomaly.m
-
curl -L -o Mean2EccAnomaly.m https://huggingface.co/datasets/STAR-future/Trinity-SpaceData/resolve/main/conjunction/nasa_cara/DistributedMatlab/Utils/OrbitTransformations/Mean2EccAnomaly.m
667 Bytes
| function [EA] = Mean2EccAnomaly(M,e) | |
| sz = numel(M); | |
| EA = zeros(sz,1); | |
| id = -pi<M & M<0 | M>pi; | |
| EA(id) = M(id) - e(id); | |
| % EA(~id) = M(~id) + e(~id); | |
| id = ~id; | |
| EA(id) = M(id) + e(id); | |
| % if (-pi<M && M<0 || M>pi) | |
| % EA = M-e; | |
| % else | |
| % EA = M+e; | |
| % end | |
| tol = 1e-13 * ones(sz,1); | |
| delta = ones(sz,1); | |
| EAold = EA; | |
| EAnew = EA; | |
| while(delta > tol) | |
| EAnew = EAold + ((M-EAold+e.*sin(EAold))./(1-e.*cos(EAold))); | |
| delta = abs(EAnew - EAold); | |
| EAold = EAnew; | |
| end | |
| EA = EAnew; | |
| end |