[−][src]Struct cubic_spline::SplineOpts
A list of options indicating how the spline should be calculated
use cubic_spline::SplineOpts; let o1 = SplineOpts::default(); let o2 = SplineOpts::new(); let o3 = SplineOpts::new() .tension(0.5) .num_of_segments(16);
Options list:
-
tension
- Sets the bending strength of the curve. The usual value ranges from0.0
(straight) to1.0
(very rounded). If not specifiedDEFAULT_TENSION
will be used. -
num_of_segments
- The number of points to be calculated between each two known points. If not specifiedDEFAULT_SEGMENTS
will be used. -
hidden_point_at_start
- A point that will not be drawn, but the beginning of the graph will bend as if it is there. -
hidden_point_at_end
- Same as previous, but affects the end of the graph.
Implementations
impl SplineOpts
[src]
pub fn new() -> Self
[src]
Creates new one with defaults.
pub fn tension(self, val: f64) -> Self
[src]
Sets tension.
pub fn num_of_segments(self, val: u32) -> Self
[src]
Sets num_of_segments.
pub fn hidden_point_at_start<T: Into<Point>>(self, val: T) -> Self
[src]
Sets hidden_point_at_start.
pub fn hidden_point_at_end<T: Into<Point>>(self, val: T) -> Self
[src]
Sets hidden_point_at_end.
pub fn get_tension(&self) -> f64
[src]
pub fn get_num_of_segments(&self) -> u32
[src]
pub fn get_hidden_point_at_start(&self) -> Option<&Point>
[src]
pub fn get_hidden_point_at_end(&self) -> Option<&Point>
[src]
Trait Implementations
impl Clone for SplineOpts
[src]
pub fn clone(&self) -> SplineOpts
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for SplineOpts
[src]
pub fn default() -> Self
[src]
Example
use cubic_spline::{SplineOpts}; let opts = SplineOpts::default(); assert_eq!(opts.get_num_of_segments(), cubic_spline::DEFAULT_SEGMENTS); assert!((opts.get_tension() - cubic_spline::DEFAULT_TENSION).abs() < 1e-9); assert!(opts.get_hidden_point_at_end().is_none());
Auto Trait Implementations
impl RefUnwindSafe for SplineOpts
[src]
impl Send for SplineOpts
[src]
impl Sync for SplineOpts
[src]
impl Unpin for SplineOpts
[src]
impl UnwindSafe for SplineOpts
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,