roots
This commit is contained in:
@@ -14,6 +14,7 @@ pub struct FunctionOutput {
|
||||
pub(crate) integral: Option<(Vec<Bar>, f64)>,
|
||||
pub(crate) derivative: Option<Vec<Value>>,
|
||||
pub(crate) extrema: Option<Vec<Value>>,
|
||||
pub(crate) roots: Option<Vec<Value>>,
|
||||
}
|
||||
|
||||
impl FunctionOutput {
|
||||
@@ -23,6 +24,7 @@ impl FunctionOutput {
|
||||
integral: None,
|
||||
derivative: None,
|
||||
extrema: None,
|
||||
roots: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +33,7 @@ impl FunctionOutput {
|
||||
self.integral = None;
|
||||
self.derivative = None;
|
||||
self.extrema = None;
|
||||
self.roots = None;
|
||||
}
|
||||
|
||||
pub fn invalidate_back(&mut self) { self.back = None; }
|
||||
@@ -68,6 +71,15 @@ impl FunctionOutput {
|
||||
);
|
||||
}
|
||||
|
||||
if let Some(roots_data) = self.roots.clone() {
|
||||
plot_ui.points(
|
||||
Points::new(Values::from_values(roots_data))
|
||||
.color(Color32::LIGHT_BLUE)
|
||||
.name("Root")
|
||||
.radius(5.0),
|
||||
);
|
||||
}
|
||||
|
||||
if let Some(integral_data) = self.integral.clone() {
|
||||
plot_ui.bar_chart(
|
||||
BarChart::new(integral_data.0)
|
||||
|
||||
Reference in New Issue
Block a user