pub fn add_control_point(mut self, control_point: f64) -> Terrace<'a, T> {
        // check to see if the vector already contains the input point.
        if !self.control_points
            .iter()
            .any(|&x| (x - control_point).abs() < std::f64::EPSILON)
        {
            // it doesn't, so find the correct position to insert the new
            // control point.
            let insertion_point = self.control_points
                .iter()
                .position(|&x| x >= control_point)
                .unwrap_or_else(|| self.control_points.len());

            // add the new control point at the correct position.
            self.control_points.insert(insertion_point, control_point);
        }

        // create new Terrace with updated control_points vector
        Terrace { ..self }
    }
/// Adds a control point to the terrace-forming curve.
///
/// Two or more control points define the terrace-forming curve. The start
/// of this curve has a slope of zero; its slope then smoothly increases.
/// At the control points, its slope resets to zero.
///
/// It does not matter which order these points are added in.
Adds a control point to the terrace-forming curve.
Two or more control points define the terrace-forming curve. The start
of this curve has a slope of zero; its slope then smoothly increases.
At the control points, its slope resets to zero.

It does not matter which order these points are added in.
Adds a control point to the terrace - forming curve . Two or more control points define the terrace - forming curve . The start of this curve has a slope of zero ; its slope then smoothly increases . At the control points its slope resets to zero . It does not matter which order these points are added in .
pub fn add_control_point(mut self, control_point: f64) -> Terrace<'a, T> {
        // check to see if the vector already contains the input point.
        if !self.control_points
            .iter()
            .any(|&x| (x - control_point).abs() < std::f64::EPSILON)
        {
            // it doesn't, so find the correct position to insert the new
            // control point.
            let insertion_point = self.control_points
                .iter()
                .position(|&x| x >= control_point)
                .unwrap_or_else(|| self.control_points.len());
            // add the new control point at the correct position.
            self.control_points.insert(insertion_point, control_point);
        }
        // create new Terrace with updated control_points vector
        Terrace { ..self }
    }
pub fn add_control_point ( mut self , control_point : f64 ) -> Terrace < ' a , T > { // check to see if the vector already contains the input point. if ! self . control_points . iter ( ) . any ( | & x | ( x - control_point ) . abs ( ) < std :: f64 :: EPSILON ) { // it doesn't, so find the correct position to insert the new // control point. let insertion_point = self . control_points . iter ( ) . position ( | & x | x >= control_point ) . unwrap_or_else ( | | self . control_points . len ( ) ) ; // add the new control point at the correct position. self . control_points . insert ( insertion_point , control_point ) ; } // create new Terrace with updated control_points vector Terrace { .. self } }
Adds a control point to the terrace-forming curve.
Adds a control point to the terrace - forming curve .
mut self
control_point
f64