Struct Vector3

Source
pub struct Vector3<T: PhysicsQuantity> {
    pub data: [T; 3],
}

Fields§

§data: [T; 3]

Implementations§

Source§

impl<T: PhysicsQuantity> Vector3<T>

Source

pub fn from_ndarray(array: ArrayView1<'_, T>) -> Result<Self, String>

Source§

impl Vector3<f64>

Source

pub fn x() -> Self

Source

pub fn y() -> Self

Source

pub fn z() -> Self

Source§

impl<T: PhysicsQuantity> Vector3<T>

Source

pub fn new(data: [T; 3]) -> Self

Source

pub fn zero() -> Self

Source

pub fn data(&self) -> [T; 3]

Source

pub fn from_f64(data: [f64; 3]) -> Self

Source

pub fn to_ndarray(&self) -> Array1<T>

Source

pub fn norm(&self) -> T

Source

pub fn to_unit_vector(&self) -> Vector3<f64>

Source

pub fn to_raw(&self) -> Vector3<f64>

👎Deprecated since 0.2.9: please use as_f64() instead
Source

pub fn as_f64(&self) -> Vector3<f64>

Source

pub fn from_raw(raw: Vector3<f64>) -> Self

Source

pub fn optimize(&mut self)

Source§

impl<T: PhysicsQuantity> Vector3<T>

Source

pub fn cross<U, V>(&self, b: &Vector3<U>) -> Vector3<V>
where T: Mul<U, Output = V>, U: PhysicsQuantity, V: PhysicsQuantity + Sub<Output = V>,

Source§

impl<T: PhysicsQuantity> Vector3<T>

Source

pub fn dot_vct<U, V>(&self, other: &Vector3<U>) -> V
where T: Mul<U, Output = V>, U: PhysicsQuantity, V: PhysicsQuantity + Add<Output = V>,

Trait Implementations§

Source§

impl<T: PhysicsQuantity> Add for Vector3<T>

Source§

type Output = Vector3<T>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl<T: PhysicsQuantity> AddAssign for Vector3<T>

Source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
Source§

impl<T: Clone + PhysicsQuantity> Clone for Vector3<T>

Source§

fn clone(&self) -> Vector3<T>

Returns a duplicate 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<T: Debug + PhysicsQuantity> Debug for Vector3<T>

Source§

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

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

impl<T: PhysicsQuantity + Display> Display for Vector3<T>

Source§

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

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

impl<T, U, V> Div<U> for Vector3<T>
where T: PhysicsQuantity + Div<U, Output = V>, U: PhysicsQuantity, V: PhysicsQuantity,

Source§

type Output = Vector3<V>

The resulting type after applying the / operator.
Source§

fn div(self, scalar: U) -> Vector3<V>

Performs the / operation. Read more
Source§

impl<T: PhysicsQuantity> DivAssign<f64> for Vector3<T>

Source§

fn div_assign(&mut self, scalar: f64)

Performs the /= operation. Read more
Source§

impl<T: PhysicsQuantity> Index<usize> for Vector3<T>

Source§

type Output = T

The returned type after indexing.
Source§

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

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

impl<T: PhysicsQuantity> IndexMut<usize> for Vector3<T>

Source§

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

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

impl<T, U, V> Mul<U> for Vector3<T>
where T: PhysicsQuantity + Mul<U, Output = V>, U: PhysicsQuantity, V: PhysicsQuantity,

Source§

type Output = Vector3<V>

The resulting type after applying the * operator.
Source§

fn mul(self, scalar: U) -> Vector3<V>

Performs the * operation. Read more
Source§

impl<T, U, V> Mul<Vector3<U>> for Matrix2x3<T>
where T: PhysicsQuantity + Mul<U, Output = V>, U: PhysicsQuantity, V: PhysicsQuantity + Add<Output = V>,

Source§

type Output = Vector2<V>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<U>) -> Vector2<V>

Performs the * operation. Read more
Source§

impl<T, U, V> Mul<Vector3<U>> for Vector3<T>
where T: PhysicsQuantity + Mul<U, Output = V>, U: PhysicsQuantity, V: PhysicsQuantity,

Source§

type Output = Vector3<V>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Vector3<U>) -> Vector3<V>

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for Acceleration

Source§

type Output = Vector3<Acceleration>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for Angle

Source§

type Output = Vector3<Angle>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for AngularAcceleration

Source§

type Output = Vector3<AngularAcceleration>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for AngularVelocity

Source§

type Output = Vector3<AngularVelocity>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for Area

Source§

type Output = Vector3<Area>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for AreaOfMoment

Source§

type Output = Vector3<AreaOfMoment>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for Charge

Source§

type Output = Vector3<Charge>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for Compliance

Source§

type Output = Vector3<Compliance>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for Density

Source§

type Output = Vector3<Density>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for Distance

Source§

type Output = Vector3<Distance>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for Force

Source§

type Output = Vector3<Force>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for ForceArea

Source§

type Output = Vector3<ForceArea>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for ForceDistance

Source§

type Output = Vector3<ForceDistance>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for ForcePerDistancePowerFour

Source§

type Output = Vector3<ForcePerDistancePowerFour>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for ForcePerVolume

Source§

type Output = Vector3<ForcePerVolume>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for ForceVolume

Source§

type Output = Vector3<ForceVolume>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for InverseArea

Source§

type Output = Vector3<InverseArea>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for InverseDistance

Source§

type Output = Vector3<InverseDistance>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for Mass

Source§

type Output = Vector3<Mass>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for MassPerDistanceTimeSquare

Source§

type Output = Vector3<MassPerDistanceTimeSquare>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for MassPerTimeSquare

Source§

type Output = Vector3<MassPerTimeSquare>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for Stiffness

Source§

type Output = Vector3<Stiffness>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for Strain

Source§

type Output = Vector3<Strain>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for Stress

Source§

type Output = Vector3<Stress>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for StressSquared

Source§

type Output = Vector3<StressSquared>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for Time

Source§

type Output = Vector3<Time>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for Velocity

Source§

type Output = Vector3<Velocity>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for VelocitySquared

Source§

type Output = Vector3<VelocitySquared>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for Voltage

Source§

type Output = Vector3<Voltage>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Vector3<f64>> for Volume

Source§

type Output = Vector3<Volume>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Vector3<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: PhysicsQuantity> MulAssign<f64> for Vector3<T>

Source§

fn mul_assign(&mut self, scalar: f64)

Performs the *= operation. Read more
Source§

impl<T> Neg for Vector3<T>
where T: PhysicsQuantity + Neg<Output = T>,

Source§

type Output = Vector3<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<T: PartialEq + PhysicsQuantity> PartialEq for Vector3<T>

Source§

fn eq(&self, other: &Vector3<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: PhysicsQuantity> Sub for Vector3<T>

Source§

type Output = Vector3<T>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl<T: PhysicsQuantity> SubAssign for Vector3<T>

Source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
Source§

impl<T: PhysicsQuantity + Zero> Zero for Vector3<T>

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<T: Copy + PhysicsQuantity> Copy for Vector3<T>

Source§

impl<T: PhysicsQuantity> StructuralPartialEq for Vector3<T>

Auto Trait Implementations§

§

impl<T> Freeze for Vector3<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Vector3<T>
where T: RefUnwindSafe,

§

impl<T> Send for Vector3<T>
where T: Send,

§

impl<T> Sync for Vector3<T>
where T: Sync,

§

impl<T> Unpin for Vector3<T>
where T: Unpin,

§

impl<T> UnwindSafe for Vector3<T>
where T: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

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>,

Source§

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.