pub fn linear(&self, x: f32) -> f32 {
        let p = (x - self.domain.start) / (self.domain.end - self.domain.start);
        let r = self.range.start + p * (self.range.end - self.range.start);
        let r = r.max(self.range.start);
        let r = r.min(self.range.end);
        r
    }
/// Translates value from domain to range scale.
/// ```
/// # extern crate textplots;
/// # use textplots::scale::Scale;
/// assert_eq!(-0.8, Scale::new(0_f32..10_f32, -1_f32..1_f32).linear(1.0));
/// ```
Translates value from domain to range scale.
Translates value from domain to range scale .
pub fn linear(&self, x: f32) -> f32 {
        let p = (x - self.domain.start) / (self.domain.end - self.domain.start);
        let r = self.range.start + p * (self.range.end - self.range.start);
        let r = r.max(self.range.start);
        let r = r.min(self.range.end);
        r
    }
pub fn linear ( & self , x : f32 ) -> f32 { let p = ( x - self . domain . start ) / ( self . domain . end - self . domain . start ) ; let r = self . range . start + p * ( self . range . end - self . range . start ) ; let r = r . max ( self . range . start ) ; let r = r . min ( self . range . end ) ; r }
Translates value from domain to range scale.
Translates value from domain to range scale .
&self
x
f32
&self
x
f32
extern crate textplots;
None
use textplots::scale::scale;
None