File tree 1 file changed +7
-0
lines changed
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ use crate::linalg::DefaultAllocator;
26
26
use crate :: time:: { Duration , Unit } ;
27
27
use crate :: State ;
28
28
use anise:: prelude:: { Almanac , Frame } ;
29
+ use anise:: structure:: planetocentric:: ellipsoid:: Ellipsoid ;
29
30
#[ cfg( feature = "python" ) ]
30
31
use pyo3:: prelude:: * ;
31
32
use std:: default:: Default ;
@@ -154,6 +155,12 @@ impl Event {
154
155
Self :: new ( StateParameter :: Apoapsis , 180.0 )
155
156
}
156
157
158
+ /// Match the central body's mean equatorial radius.
159
+ /// This is useful for detecting when an object might impact the central body.
160
+ pub fn mean_surface ( body : & Ellipsoid ) -> Self {
161
+ Self :: new ( StateParameter :: Rmag , body. mean_equatorial_radius_km ( ) )
162
+ }
163
+
157
164
/// Match a specific event in another frame, using the default epoch precision and value.
158
165
pub fn in_frame ( parameter : StateParameter , desired_value : f64 , target_frame : Frame ) -> Self {
159
166
warn ! ( "Searching for an event in another frame is slow: you should instead convert the trajectory into that other frame" ) ;
You can’t perform that action at this time.
0 commit comments