(args: &CmdlineOptions)
| 107 | type DynamicalSystemFn = Box<dyn Fn(f64, f64) -> (f64, f64) + 'static>; |
| 108 | |
| 109 | fn build_dynamical_system_function(args: &CmdlineOptions) -> eyre::Result<DynamicalSystemFn> { |
| 110 | // Interpret the CLI arguments to build the dynamical system function |
| 111 | if !args.math.is_empty() || args.script.is_some() { |
| 112 | build_dynamical_system_function_from_args(args) |
| 113 | } else { |
| 114 | // If no --math arguments are provided, use a default function useful for prototyping |
| 115 | Ok(Box::new(|x, y| { |
| 116 | ( |
| 117 | f64::sin(0.97 * y) - f64::cos(-1.899 * x), |
| 118 | f64::sin(1.381 * x) - f64::cos(-1.506 * y), |
| 119 | ) |
| 120 | })) |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | fn build_dynamical_system_function_from_args( |
| 125 | args: &CmdlineOptions, |
no test coverage detected