Struct lis2dh12::F32x3

source ·
pub struct F32x3 {
    pub x: f32,
    pub y: f32,
    pub z: f32,
}
Expand description

3-dimensional XYZ vector of f32 values

Fields§

§x: f32

X component

§y: f32

Y component

§z: f32

Z component

Implementations§

source§

impl F32x3

source

pub fn new(x: f32, y: f32, z: f32) -> F32x3

Instantiate from X,Y,Z components

Trait Implementations§

source§

impl Clone for F32x3

source§

fn clone(&self) -> F32x3

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 Debug for F32x3

source§

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

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

impl Default for F32x3

source§

fn default() -> F32x3

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

impl From<(f32, f32, f32)> for F32x3

source§

fn from(vector: (f32, f32, f32)) -> F32x3

Converts to this type from the input type.
source§

impl From<I16x3> for F32x3

source§

fn from(vector: I16x3) -> F32x3

Converts to this type from the input type.
source§

impl From<I8x3> for F32x3

source§

fn from(vector: I8x3) -> F32x3

Converts to this type from the input type.
source§

impl From<U16x3> for F32x3

source§

fn from(vector: U16x3) -> F32x3

Converts to this type from the input type.
source§

impl From<U8x3> for F32x3

source§

fn from(vector: U8x3) -> F32x3

Converts to this type from the input type.
source§

impl Index<usize> for F32x3

§

type Output = f32

The returned type after indexing.
source§

fn index(&self, i: usize) -> &f32

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

impl MulAssign<f32> for F32x3

source§

fn mul_assign(&mut self, n: f32)

Performs the *= operation. Read more
source§

impl PartialEq for F32x3

source§

fn eq(&self, other: &F32x3) -> 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 Vector for F32x3

§

type Component = f32

Type representing measured acceleration for a particular axis
§

type Axes = UInt<UInt<UTerm, B1>, B1>

Number of axes
source§

const MIN: f32 = -3.40282347E+38f32

Smallest value representable by a vector component
source§

const MAX: f32 = 3.40282347E+38f32

Largest value representable by a vector component
source§

fn from_iter<I>(into_iter: I) -> F32x3
where I: IntoIterator<Item = <F32x3 as Vector>::Component>,

Instantiate a Vector from an iterator over Self::Component values. Read more
source§

fn get(self, i: usize) -> Option<<F32x3 as Vector>::Component>

Get the component value for a particular index
source§

fn to_array(self) -> GenericArray<f32, UInt<UInt<UTerm, B1>, B1>>

Obtain an array of the acceleration components for each of the axes
source§

fn from_slice(slice: &[Self::Component]) -> Self

Instantiate a vector from a slice of components. Read more
source§

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

Iterate over the components of a vector
source§

impl Copy for F32x3

source§

impl StructuralPartialEq for F32x3

Auto Trait Implementations§

§

impl RefUnwindSafe for F32x3

§

impl Send for F32x3

§

impl Sync for F32x3

§

impl Unpin for F32x3

§

impl UnwindSafe for F32x3

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.
source§

impl<V, A, C> VectorExt for V
where V: Vector<Axes = A, Component = C> + MulAssign<f32>, A: ArrayLength<C>, C: Component + Into<f32>,

source§

fn distance(self, other: V) -> f32

Compute the distance between two vectors

source§

fn magnitude(self) -> f32

Compute the magnitude of a vector