fn error(&self, new_vector: [f64; 2], dt: f64) -> f64 {
        use vecmath::vec2_sub as sub;
        use vecmath::vec2_scale as scale;
        use vecmath::vec2_len as len;

        // The actual change in distance per unit of time.
        let change = scale(sub(new_vector, self.get_old_vector()), 1.0 / dt);
        let error = len(sub(change, self.predict(self.get_value(), dt))).powi(2);
        error + (self.get_error() - error).abs()
    }
/// Returns error from current prediction.
///
/// The error includes a term for predicted error.
Returns error from current prediction.
The error includes a term for predicted error.
Returns error from current prediction . The error includes a term for predicted error .
fn error(&self, new_vector: [f64; 2], dt: f64) -> f64 {
        use vecmath::vec2_sub as sub;
        use vecmath::vec2_scale as scale;
        use vecmath::vec2_len as len;
        // The actual change in distance per unit of time.
        let change = scale(sub(new_vector, self.get_old_vector()), 1.0 / dt);
        let error = len(sub(change, self.predict(self.get_value(), dt))).powi(2);
        error + (self.get_error() - error).abs()
    }
fn error ( & self , new_vector : [ f64 ; 2 ] , dt : f64 ) -> f64 { use vecmath :: vec2_sub as sub ; use vecmath :: vec2_scale as scale ; use vecmath :: vec2_len as len ; // The actual change in distance per unit of time. let change = scale ( sub ( new_vector , self . get_old_vector ( ) ) , 1.0 / dt ) ; let error = len ( sub ( change , self . predict ( self . get_value ( ) , dt ) ) ) . powi ( 2 ) ; error + ( self . get_error ( ) - error ) . abs ( ) }
Returns error from current prediction.
Returns error from current prediction .
&self
new_vector
[f64; 2]
dt
f64
&self
new_vector
[f64; 2]
dt
f64