pub type Force<N> = Force2<N>;
Expand description

The force type combining a linear force and a torque.

Aliased Type§

struct Force<N> {
    pub linear: Matrix<N, Const<2>, Const<1>, ArrayStorage<N, 2, 1>>,
    pub angular: N,
}

Fields§

§linear: Matrix<N, Const<2>, Const<1>, ArrayStorage<N, 2, 1>>

The linear force.

§angular: N

The torque.

Implementations§

source§

impl<N> Force2<N>where N: RealField + Copy,

source

pub fn new( linear: Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, angular: N ) -> Force2<N>

Creates a force from its linear and angular components.

source

pub fn zero() -> Force2<N>

A zero force.

source

pub fn from_slice(data: &[N]) -> Force2<N>

Create a force from a slice where the entries 0 and 1 are for the linear part and 2 for the angular part.

source

pub fn from_vector<S>( data: &Matrix<N, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, S> ) -> Force2<N>where S: Storage<N, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>>,

Create a force from a vector where the entries 0 and 1 are for the linear part and 2 for the angular part.

source

pub fn from_vectors( linear: Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, angular: Matrix<N, Const<1>, Const<1>, ArrayStorage<N, 1, 1>> ) -> Force2<N>

Creates a force from its linear and angular components, both in vector form.

source

pub fn torque(torque: N) -> Force2<N>

Create a pure torque.

source

pub fn torque_from_vector( torque: Matrix<N, Const<1>, Const<1>, ArrayStorage<N, 1, 1>> ) -> Force2<N>

Create a pure torque.

source

pub fn linear( linear: Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>> ) -> Force2<N>

Create a pure linear force.

source

pub fn linear_at_point( linear: Matrix<N, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<N, 2, 1>>, point: &OPoint<N, Const<2>> ) -> Force2<N>

Creates the resultant of a linear force applied at the given point (relative to the center of mass).

source

pub fn torque_at_point(torque: N, point: &OPoint<N, Const<2>>) -> Force2<N>

Creates the resultant of a torque applied at the given point (relative to the center of mass).

source

pub fn torque_from_vector_at_point( torque: Matrix<N, Const<1>, Const<1>, ArrayStorage<N, 1, 1>>, point: &OPoint<N, Const<2>> ) -> Force2<N>

Creates the resultant of a torque applied at the given point (relative to the center of mass).

source

pub fn angular_vector( &self ) -> Matrix<N, Const<1>, Const<1>, ArrayStorage<N, 1, 1>>

The angular part of the force.

source

pub fn transform_by(&self, m: &Isometry<N, Unit<Complex<N>>, 2>) -> Force2<N>

Apply the given transformation to this force.

source

pub fn as_slice(&self) -> &[N]

This force seen as a slice.

The two first entries contain the linear part and the third entry contais the angular part.

source

pub fn as_vector( &self ) -> &Matrix<N, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<N, 3, 1>>

This force seen as a vector.

The two first entries contain the linear part and the third entry contais the angular part.

source

pub fn as_vector_mut( &mut self ) -> &mut Matrix<N, Const<nalgebra::::base::dimension::U3::{constant#0}>, Const<1>, ArrayStorage<N, 3, 1>>

This force seen as a mutable vector.

The two first entries contain the linear part and the third entry contais the angular part.

Trait Implementations§

source§

impl<N> Add<Force2<N>> for Force2<N>where N: RealField + Copy,

§

type Output = Force2<N>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Force2<N>) -> Force2<N>

Performs the + operation. Read more
source§

impl<N> AddAssign<Force2<N>> for Force2<N>where N: RealField + Copy,

source§

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

Performs the += operation. Read more
source§

impl<N> Clone for Force2<N>where N: Clone + RealField + Copy,

source§

fn clone(&self) -> Force2<N>

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 for Force2<N>where N: Debug + RealField + Copy,

source§

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

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

impl<N> Mul<N> for Force2<N>where N: RealField + Copy,

§

type Output = Force2<N>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: N) -> Force2<N>

Performs the * operation. Read more
source§

impl<N> Neg for Force2<N>where N: RealField + Copy,

§

type Output = Force2<N>

The resulting type after applying the - operator.
source§

fn neg(self) -> Force2<N>

Performs the unary - operation. Read more
source§

impl<N> Sub<Force2<N>> for Force2<N>where N: RealField + Copy,

§

type Output = Force2<N>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Force2<N>) -> Force2<N>

Performs the - operation. Read more
source§

impl<N> SubAssign<Force2<N>> for Force2<N>where N: RealField + Copy,

source§

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

Performs the -= operation. Read more
source§

impl<N> Copy for Force2<N>where N: Copy + RealField,