pub struct Vector {
pub value: Value,
pub theta: f64,
}Expand description
A struct that holds a Value struct and direction
Fields§
§value: ValueValue Struct
theta: f64Angle of Vector in radians
Implementations§
Trait Implementations§
Source§impl From<Vector> for Cartesian
Transform Vector to Cartesian
impl From<Vector> for Cartesian
Transform Vector to Cartesian
let v = Vector{
value:Value{
magnitude:1_f64,
si_units_num: Vec::from([SiUnit::Kilogram,SiUnit::Metres])
si_units_den: Vec::from([SiUnit::Seconds,SiUnit::Seconds])
}
theta:crate::PI
};
let cart:Cartesian = v.into()
println!("{}",cart);Auto Trait Implementations§
impl Freeze for Vector
impl RefUnwindSafe for Vector
impl Send for Vector
impl Sync for Vector
impl Unpin for Vector
impl UnsafeUnpin for Vector
impl UnwindSafe for Vector
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more