Trait CurvePoint

Source
pub trait CurvePoint<F: Float>: Clone + PartialEq {
    // Required methods
    fn add(&self, other: &Self) -> Self;
    fn sub(&self, other: &Self) -> Self;
    fn multiply(&self, other: &Self) -> Self;
    fn scale(&self, s: F) -> Self;
}
Expand description

CurvePoint is a point in space that can be added, subtracted, multiplied, and scaled. This trait can be implemented for any type like Point, Vector, Color, etc.

Required Methods§

Source

fn add(&self, other: &Self) -> Self

Source

fn sub(&self, other: &Self) -> Self

Source

fn multiply(&self, other: &Self) -> Self

Source

fn scale(&self, s: F) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<F: Float> CurvePoint<F> for f32

Source§

fn add(&self, other: &Self) -> Self

Source§

fn sub(&self, other: &Self) -> Self

Source§

fn multiply(&self, other: &f32) -> Self

Source§

fn scale(&self, s: F) -> Self

Source§

impl<F: Float> CurvePoint<F> for f64

Source§

fn add(&self, other: &Self) -> Self

Source§

fn sub(&self, other: &Self) -> Self

Source§

fn multiply(&self, other: &f64) -> Self

Source§

fn scale(&self, s: F) -> Self

Implementors§