1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use super::{CalculationResult, CalculationStep};
use crate::errors::Result;

pub type Bounds = (f64, f64);

pub trait EquationOfOneVariable {
    fn calculate(&self, value: CalculationStep, bounds: Bounds) -> Result<CalculationResult>;
}

pub trait EquationOfTwoVariable {
    fn calculate(
        &self,
        value1: CalculationStep,
        bounds1: Bounds,
        value2: CalculationStep,
        bounds2: Bounds,
    ) -> Result<CalculationResult>;
}

pub trait EquationOfThreeVariable {
    fn calculate(
        &self,
        value1: CalculationStep,
        bounds2: Bounds,
        value2: CalculationStep,
        bounds2: Bounds,
        value3: CalculationStep,
        bounds3: Bounds,
    ) -> Result<CalculationResult>;
}