Struct pythagore::force::force_nd::Force

source ·
pub struct Force<N: Num, const D: usize> { /* private fields */ }
Expand description

Force<N, D> structure for D dimension forces

Implementations§

source§

impl<N: Copy + Num, const D: usize> Force<N, D>

source

pub fn null() -> Self

Returns a null force

Example
use pythagore::{force, Force2D, Force3D};

assert_eq!(Force2D::null(), force!{ dx: 0, dy: 0 });
assert_eq!(Force3D::null(), force!{ dx: 0, dy: 0, dz: 0 });
source

pub fn is_null(&self) -> bool

Returns true if force is null

source§

impl<N: Num, const D: usize> Force<N, D>

source

pub fn iter(&self) -> Iter<'_, N>

Returns iterator on force elements

source

pub fn iter_mut(&mut self) -> IterMut<'_, N>

Returns iterator on force elements

source§

impl<N: Copy + Num + Sum, const D: usize> Force<N, D>

source

pub fn square_norm(&self) -> N

Returns the squared norm of force

Example
use pythagore::force;

assert_eq!(force!{ dx: 2, dy: 3 }.square_norm(), 13);
assert_eq!(force!{ dx: 2, dy: 3, dz: 4 }.square_norm(), 29);
source§

impl<N: Copy + Float + Sum, const D: usize> Force<N, D>

source

pub fn norm(&self) -> N

Returns the norm of force (only for float forces)

Example
use pythagore::force;

assert_eq!(force!{ dx: 1.0, dy: 0.0 }.norm(), 1.0);
assert_eq!(force!{ dx: 0.0, dy: 0.0, dz: 4.0 }.norm(), 4.0);
source

pub fn unit(&self) -> Self

Returns a unit force from force (only for float forces)

Example
use pythagore::force;

assert_eq!(force!{ dx: 10.0, dy: 0.0 }.unit(), force!{ dx: 1.0, dy: 0.0 });
assert_eq!(force!{ dx: 0.0, dy: 0.0, dz: 5.0 }.unit(), force!{ dx: 0.0, dy: 0.0, dz: 1.0 });
source§

impl<N: Copy + Signed + Sum, const D: usize> Force<N, D>

source

pub fn manhattan_norm(&self) -> N

Returns the norm of force (only for signed forces)

Example
use pythagore::force;

assert_eq!(force!{ dx: 1, dy: -2 }.manhattan_norm(), 3);
assert_eq!(force!{ dx: 1, dy: -2, dz: 3 }.manhattan_norm(), 6);
source§

impl<N: Copy + Num> Force<N, 4>

source

pub fn unit_dx() -> Self

Returns dx unit force

Example
use pythagore::{force, Force3D};

assert_eq!(Force3D::unit_dx(), force!{ dx: 1, dy: 0, dz: 0 });
source

pub fn unit_dy() -> Self

Returns dy unit force

Example
use pythagore::{force, Force3D};

assert_eq!(Force3D::unit_dy(), force!{ dx: 0, dy: 1, dz: 0 });
source

pub fn unit_dz() -> Self

Returns dz unit force

Example
use pythagore::{force, Force3D};

assert_eq!(Force3D::unit_dz(), force!{ dx: 0, dy: 0, dz: 1 });
source

pub fn dx(&self) -> &N

Returns ref on dx element of force

Example
use pythagore::force;

assert_eq!(force!{ dx: 1, dy: 2, dz: 3 }.dx(), &1);
source

pub fn dx_mut(&mut self) -> &mut N

Returns mutable ref on dx element of force

Example
use pythagore::force;

let mut v = force!{ dx: 1, dy: 2, dz: 3 };
*v.dx_mut() = 5;

assert_eq!(v.dx(), &5);
source

pub fn dy(&self) -> &N

Returns ref on dy element of force

Example
use pythagore::force;

assert_eq!(force!{ dx: 1, dy: 2, dz: 3 }.dy(), &2);
source

pub fn dy_mut(&mut self) -> &mut N

Returns mutable ref on dy element of force

Example
use pythagore::force;

let mut v = force!{ dx: 1, dy: 2, dz: 3 };
*v.dy_mut() = 5;

assert_eq!(v.dy(), &5);
source

pub fn dz(&self) -> &N

Returns ref on dz element of force

Example
use pythagore::force;

assert_eq!(force!{ dx: 1, dy: 2, dz: 3 }.dz(), &3);
source

pub fn dz_mut(&mut self) -> &mut N

Returns mutable ref on dz element of force

Example
use pythagore::force;

let mut v = force!{ dx: 1, dy: 2, dz: 3 };
*v.dz_mut() = 5;

assert_eq!(v.dz(), &5);
source§

impl<N: Copy + Num> Force<N, 3>

source

pub fn unit_dx() -> Self

Returns dx unit force

Example
use pythagore::{force, Force2D};

assert_eq!(Force2D::unit_dx(), force!{ dx: 1, dy: 0 });
source

pub fn unit_dy() -> Self

Returns dy unit force

Example
use pythagore::{force, Force2D};

assert_eq!(Force2D::unit_dy(), force!{ dx: 0, dy: 1 });
source

pub fn dx(&self) -> &N

Returns ref on dx element of force

Example
use pythagore::force;

assert_eq!(force!{ dx: 1, dy: 2 }.dx(), &1);
source

pub fn dx_mut(&mut self) -> &mut N

Returns mutable ref on dx element of force

Example
use pythagore::force;

let mut v = force!{ dx: 1, dy: 2 };
*v.dx_mut() = 5;

assert_eq!(v.dx(), &5);
source

pub fn dy(&self) -> &N

Returns ref on dy element of force

Example
use pythagore::force;

assert_eq!(force!{ dx: 1, dy: 2 }.dy(), &2);
source

pub fn dy_mut(&mut self) -> &mut N

Returns mutable ref on dy element of force

Example
use pythagore::force;

let mut v = force!{ dx: 1, dy: 2 };
*v.dy_mut() = 5;

assert_eq!(v.dy(), &5);

Trait Implementations§

source§

impl<N: Copy + Num, const D: usize> Add<&Force<N, D>> for &Force<N, D>

§

type Output = Force<N, D>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Force<N, D>) -> Self::Output

Performs the + operation. Read more
source§

impl<N: Copy + Num, const D: usize> Add<&Force<N, D>> for &Point<N, D>

§

type Output = Point<N, D>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Force<N, D>) -> Self::Output

Performs the + operation. Read more
source§

impl<N: Copy + Num, const D: usize> Add<&Force<N, D>> for Force<N, D>

§

type Output = <&'static Force<N, D> as Add<&'static Force<N, D>>>::Output

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Force<N, D>) -> Self::Output

Performs the + operation. Read more
source§

impl<N: Copy + Num, const D: usize> Add<&Force<N, D>> for Point<N, D>

§

type Output = <&'static Point<N, D> as Add<&'static Force<N, D>>>::Output

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Force<N, D>) -> Self::Output

Performs the + operation. Read more
source§

impl<N: Copy + Num, const D: usize> Add<&Point<N, D>> for &Force<N, D>

§

type Output = <&'static Point<N, D> as Add<&'static Force<N, D>>>::Output

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Point<N, D>) -> Self::Output

Performs the + operation. Read more
source§

impl<N: Copy + Num, const D: usize> Add<&Point<N, D>> for Force<N, D>

§

type Output = <&'static Force<N, D> as Add<&'static Point<N, D>>>::Output

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Point<N, D>) -> Self::Output

Performs the + operation. Read more
source§

impl<N: Copy + Num, const D: usize> Add<Force<N, D>> for &Force<N, D>

§

type Output = <&'static Force<N, D> as Add<&'static Force<N, D>>>::Output

The resulting type after applying the + operator.
source§

fn add(self, rhs: Force<N, D>) -> Self::Output

Performs the + operation. Read more
source§

impl<N: Copy + Num, const D: usize> Add<Force<N, D>> for &Point<N, D>

§

type Output = <&'static Point<N, D> as Add<&'static Force<N, D>>>::Output

The resulting type after applying the + operator.
source§

fn add(self, rhs: Force<N, D>) -> Self::Output

Performs the + operation. Read more
source§

impl<N: Copy + Num, const D: usize> Add<Force<N, D>> for Force<N, D>

§

type Output = <&'static Force<N, D> as Add<&'static Force<N, D>>>::Output

The resulting type after applying the + operator.
source§

fn add(self, rhs: Force<N, D>) -> Self::Output

Performs the + operation. Read more
source§

impl<N: Copy + Num, const D: usize> Add<Force<N, D>> for Point<N, D>

§

type Output = <&'static Point<N, D> as Add<&'static Force<N, D>>>::Output

The resulting type after applying the + operator.
source§

fn add(self, rhs: Force<N, D>) -> Self::Output

Performs the + operation. Read more
source§

impl<N: Copy + Num, const D: usize> Add<Point<N, D>> for &Force<N, D>

§

type Output = <&'static Force<N, D> as Add<&'static Point<N, D>>>::Output

The resulting type after applying the + operator.
source§

fn add(self, rhs: Point<N, D>) -> Self::Output

Performs the + operation. Read more
source§

impl<N: Copy + Num, const D: usize> Add<Point<N, D>> for Force<N, D>

§

type Output = <&'static Force<N, D> as Add<&'static Point<N, D>>>::Output

The resulting type after applying the + operator.
source§

fn add(self, rhs: Point<N, D>) -> Self::Output

Performs the + operation. Read more
source§

impl<N: Copy + Num + AddAssign, const D: usize> AddAssign<&Force<N, D>> for Force<N, D>

source§

fn add_assign(&mut self, rhs: &Force<N, D>)

Performs the += operation. Read more
source§

impl<N: Copy + Num + AddAssign, const D: usize> AddAssign<&Force<N, D>> for Point<N, D>

source§

fn add_assign(&mut self, rhs: &Force<N, D>)

Performs the += operation. Read more
source§

impl<N: Copy + Num + AddAssign, const D: usize> AddAssign<Force<N, D>> for Force<N, D>

source§

fn add_assign(&mut self, rhs: Force<N, D>)

Performs the += operation. Read more
source§

impl<N: Copy + Num + AddAssign, const D: usize> AddAssign<Force<N, D>> for Point<N, D>

source§

fn add_assign(&mut self, rhs: Force<N, D>)

Performs the += operation. Read more
source§

impl<N: Num, const D: usize> AsRef<Vector<N, D>> for Force<N, D>

source§

fn as_ref(&self) -> &Vector<N, D>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<N: Clone + Num, const D: usize> Clone for Force<N, D>

source§

fn clone(&self) -> Force<N, D>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<N: Debug + Num, const D: usize> Debug for Force<N, D>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<N: Copy + Num, const D: usize> Default for Force<N, D>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<N: Copy + Num, const D: usize> Div<&N> for &Force<N, D>

§

type Output = Force<N, D>

The resulting type after applying the / operator.
source§

fn div(self, rhs: &N) -> Self::Output

Performs the / operation. Read more
source§

impl<N: Copy + Num, const D: usize> Div<&N> for Force<N, D>

§

type Output = <&'static Force<N, D> as Div<&'static N>>::Output

The resulting type after applying the / operator.
source§

fn div(self, rhs: &N) -> Self::Output

Performs the / operation. Read more
source§

impl<N: Copy + Num, const D: usize> Div<N> for &Force<N, D>

§

type Output = <&'static Force<N, D> as Div<&'static N>>::Output

The resulting type after applying the / operator.
source§

fn div(self, rhs: N) -> Self::Output

Performs the / operation. Read more
source§

impl<N: Copy + Num, const D: usize> Div<N> for Force<N, D>

§

type Output = <&'static Force<N, D> as Div<&'static N>>::Output

The resulting type after applying the / operator.
source§

fn div(self, rhs: N) -> Self::Output

Performs the / operation. Read more
source§

impl<N: Copy + Num + DivAssign, const D: usize> DivAssign<&N> for Force<N, D>

source§

fn div_assign(&mut self, rhs: &N)

Performs the /= operation. Read more
source§

impl<N: Copy + Num + DivAssign, const D: usize> DivAssign<N> for Force<N, D>

source§

fn div_assign(&mut self, rhs: N)

Performs the /= operation. Read more
source§

impl<N: Copy + Num, const D: usize> FromIterator<N> for Force<N, D>

source§

fn from_iter<T: IntoIterator<Item = N>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl<N: Num + Hash, const D: usize> Hash for Force<N, D>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<N: Num, I: SliceIndex<[N]>, const D: usize> Index<I> for Force<N, D>

§

type Output = <I as SliceIndex<[N]>>::Output

The returned type after indexing.
source§

fn index(&self, index: I) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<N: Num, I: SliceIndex<[N]>, const D: usize> IndexMut<I> for Force<N, D>

source§

fn index_mut(&mut self, index: I) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl<'a, N: Num, const D: usize> IntoIterator for &'a Force<N, D>

§

type Item = &'a N

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, N>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, N: Num, const D: usize> IntoIterator for &'a mut Force<N, D>

§

type Item = &'a mut N

The type of the elements being iterated over.
§

type IntoIter = IterMut<'a, N>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<N: Copy + Num + Sum, const D: usize> Mul<&Force<N, D>> for &Force<N, D>

§

type Output = N

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Force<N, D>) -> Self::Output

Performs the * operation. Read more
source§

impl<N: Copy + Num + Sum, const D: usize> Mul<&Force<N, D>> for Force<N, D>

§

type Output = <&'static Force<N, D> as Mul<&'static Force<N, D>>>::Output

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Force<N, D>) -> Self::Output

Performs the * operation. Read more
source§

impl<N: Copy + Num, const D: usize> Mul<&N> for &Force<N, D>

§

type Output = Force<N, D>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &N) -> Self::Output

Performs the * operation. Read more
source§

impl<N: Copy + Num, const D: usize> Mul<&N> for Force<N, D>

§

type Output = <&'static Force<N, D> as Mul<&'static N>>::Output

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &N) -> Self::Output

Performs the * operation. Read more
source§

impl<N: Copy + Num + Sum, const D: usize> Mul<&Transform<N, D>> for &Force<N, D>

§

type Output = Force<N, D>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Transform<N, D>) -> Self::Output

Performs the * operation. Read more
source§

impl<N: Copy + Num + Sum, const D: usize> Mul<&Transform<N, D>> for Force<N, D>

§

type Output = <&'static Force<N, D> as Mul<&'static Transform<N, D>>>::Output

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Transform<N, D>) -> Self::Output

Performs the * operation. Read more
source§

impl<N: Copy + Num + Sum, const D: usize> Mul<Force<N, D>> for &Force<N, D>

§

type Output = <&'static Force<N, D> as Mul<&'static Force<N, D>>>::Output

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Force<N, D>) -> Self::Output

Performs the * operation. Read more
source§

impl<N: Copy + Num + Sum, const D: usize> Mul<Force<N, D>> for Force<N, D>

§

type Output = <&'static Force<N, D> as Mul<&'static Force<N, D>>>::Output

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Force<N, D>) -> Self::Output

Performs the * operation. Read more
source§

impl<N: Copy + Num, const D: usize> Mul<N> for &Force<N, D>

§

type Output = <&'static Force<N, D> as Mul<&'static N>>::Output

The resulting type after applying the * operator.
source§

fn mul(self, rhs: N) -> Self::Output

Performs the * operation. Read more
source§

impl<N: Copy + Num, const D: usize> Mul<N> for Force<N, D>

§

type Output = <&'static Force<N, D> as Mul<&'static N>>::Output

The resulting type after applying the * operator.
source§

fn mul(self, rhs: N) -> Self::Output

Performs the * operation. Read more
source§

impl<N: Copy + Num + Sum, const D: usize> Mul<Transform<N, D>> for &Force<N, D>

§

type Output = <&'static Force<N, D> as Mul<&'static Transform<N, D>>>::Output

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Transform<N, D>) -> Self::Output

Performs the * operation. Read more
source§

impl<N: Copy + Num + Sum, const D: usize> Mul<Transform<N, D>> for Force<N, D>

§

type Output = <&'static Force<N, D> as Mul<&'static Transform<N, D>>>::Output

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Transform<N, D>) -> Self::Output

Performs the * operation. Read more
source§

impl<N: Copy + Num + MulAssign, const D: usize> MulAssign<&N> for Force<N, D>

source§

fn mul_assign(&mut self, rhs: &N)

Performs the *= operation. Read more
source§

impl<N: Copy + Num + Sum, const D: usize> MulAssign<&Transform<N, D>> for Force<N, D>

source§

fn mul_assign(&mut self, rhs: &Transform<N, D>)

Performs the *= operation. Read more
source§

impl<N: Copy + Num + MulAssign, const D: usize> MulAssign<N> for Force<N, D>

source§

fn mul_assign(&mut self, rhs: N)

Performs the *= operation. Read more
source§

impl<N: Copy + Num + Sum, const D: usize> MulAssign<Transform<N, D>> for Force<N, D>

source§

fn mul_assign(&mut self, rhs: Transform<N, D>)

Performs the *= operation. Read more
source§

impl<N: Copy + Signed, const D: usize> Neg for &Force<N, D>

§

type Output = Force<N, D>

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl<N: Copy + Signed, const D: usize> Neg for Force<N, D>

§

type Output = <&'static Force<N, D> as Neg>::Output

The resulting type after applying the - operator.
source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
source§

impl<N: Num, const D: usize> PartialEq<Force<N, D>> for Force<N, D>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<N: Copy + Num, const D: usize> Sub<&Force<N, D>> for &Force<N, D>

§

type Output = Force<N, D>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Force<N, D>) -> Self::Output

Performs the - operation. Read more
source§

impl<N: Copy + Num, const D: usize> Sub<&Force<N, D>> for &Point<N, D>

§

type Output = Point<N, D>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Force<N, D>) -> Self::Output

Performs the - operation. Read more
source§

impl<N: Copy + Num, const D: usize> Sub<&Force<N, D>> for Force<N, D>

§

type Output = <&'static Force<N, D> as Sub<&'static Force<N, D>>>::Output

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Force<N, D>) -> Self::Output

Performs the - operation. Read more
source§

impl<N: Copy + Num, const D: usize> Sub<&Force<N, D>> for Point<N, D>

§

type Output = <&'static Point<N, D> as Sub<&'static Force<N, D>>>::Output

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Force<N, D>) -> Self::Output

Performs the - operation. Read more
source§

impl<N: Copy + Num, const D: usize> Sub<&Point<N, D>> for &Force<N, D>

§

type Output = <&'static Point<N, D> as Sub<&'static Force<N, D>>>::Output

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Point<N, D>) -> Self::Output

Performs the - operation. Read more
source§

impl<N: Copy + Num, const D: usize> Sub<&Point<N, D>> for Force<N, D>

§

type Output = <&'static Force<N, D> as Sub<&'static Point<N, D>>>::Output

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Point<N, D>) -> Self::Output

Performs the - operation. Read more
source§

impl<N: Copy + Num, const D: usize> Sub<Force<N, D>> for &Force<N, D>

§

type Output = <&'static Force<N, D> as Sub<&'static Force<N, D>>>::Output

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Force<N, D>) -> Self::Output

Performs the - operation. Read more
source§

impl<N: Copy + Num, const D: usize> Sub<Force<N, D>> for &Point<N, D>

§

type Output = <&'static Point<N, D> as Sub<&'static Force<N, D>>>::Output

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Force<N, D>) -> Self::Output

Performs the - operation. Read more
source§

impl<N: Copy + Num, const D: usize> Sub<Force<N, D>> for Force<N, D>

§

type Output = <&'static Force<N, D> as Sub<&'static Force<N, D>>>::Output

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Force<N, D>) -> Self::Output

Performs the - operation. Read more
source§

impl<N: Copy + Num, const D: usize> Sub<Force<N, D>> for Point<N, D>

§

type Output = <&'static Point<N, D> as Sub<&'static Force<N, D>>>::Output

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Force<N, D>) -> Self::Output

Performs the - operation. Read more
source§

impl<N: Copy + Num, const D: usize> Sub<Point<N, D>> for &Force<N, D>

§

type Output = <&'static Force<N, D> as Sub<&'static Point<N, D>>>::Output

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Point<N, D>) -> Self::Output

Performs the - operation. Read more
source§

impl<N: Copy + Num, const D: usize> Sub<Point<N, D>> for Force<N, D>

§

type Output = <&'static Force<N, D> as Sub<&'static Point<N, D>>>::Output

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Point<N, D>) -> Self::Output

Performs the - operation. Read more
source§

impl<N: Copy + Num + SubAssign, const D: usize> SubAssign<&Force<N, D>> for Force<N, D>

source§

fn sub_assign(&mut self, rhs: &Force<N, D>)

Performs the -= operation. Read more
source§

impl<N: Copy + Num + SubAssign, const D: usize> SubAssign<&Force<N, D>> for Point<N, D>

source§

fn sub_assign(&mut self, rhs: &Force<N, D>)

Performs the -= operation. Read more
source§

impl<N: Copy + Num + SubAssign, const D: usize> SubAssign<Force<N, D>> for Force<N, D>

source§

fn sub_assign(&mut self, rhs: Force<N, D>)

Performs the -= operation. Read more
source§

impl<N: Copy + Num + SubAssign, const D: usize> SubAssign<Force<N, D>> for Point<N, D>

source§

fn sub_assign(&mut self, rhs: Force<N, D>)

Performs the -= operation. Read more
source§

impl<N: Num, const D: usize> TryFrom<Vector<N, D>> for Force<N, D>

§

type Error = ForceMustEndWithZeroError

The type returned in the event of a conversion error.
source§

fn try_from(vector: Vector<N, D>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<N: Copy + Num, const D: usize> Zero for Force<N, D>

source§

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
source§

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
source§

impl<N: Copy + Num, const D: usize> Copy for Force<N, D>

source§

impl<N: Eq + Num, const D: usize> Eq for Force<N, D>

source§

impl<N: Num, const D: usize> StructuralEq for Force<N, D>

Auto Trait Implementations§

§

impl<N, const D: usize> RefUnwindSafe for Force<N, D>where N: RefUnwindSafe,

§

impl<N, const D: usize> Send for Force<N, D>where N: Send,

§

impl<N, const D: usize> Sync for Force<N, D>where N: Sync,

§

impl<N, const D: usize> Unpin for Force<N, D>where N: Unpin,

§

impl<N, const D: usize> UnwindSafe for Force<N, D>where N: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.