Struct StaticSystem2D
pub struct StaticSystem2D {
pub forces: Vec<Force2D>,
pub moments: Vec<f64>,
}Expand description
A simple planar static system made of force vectors and scalar moments.
Fields§
§forces: Vec<Force2D>The planar forces acting on the system.
moments: Vec<f64>Free moments acting on the system.
Implementations§
§impl StaticSystem2D
impl StaticSystem2D
pub fn new(forces: Vec<Force2D>, moments: Vec<f64>) -> Option<StaticSystem2D>
pub fn new(forces: Vec<Force2D>, moments: Vec<f64>) -> Option<StaticSystem2D>
Creates a validated static system.
pub fn net_moment(&self) -> Option<f64>
pub fn net_moment(&self) -> Option<f64>
Returns the net free moment in the system.
pub fn is_equilibrium(&self, tolerance: f64) -> Option<bool>
pub fn is_equilibrium(&self, tolerance: f64) -> Option<bool>
Checks whether the system is in static equilibrium.
§Examples
use use_statics::{Force2D, StaticSystem2D};
let Some(system) = StaticSystem2D::new(
vec![
Force2D::new(1.0, 2.0).unwrap(),
Force2D::new(-1.0, -2.0).unwrap(),
],
vec![10.0, -10.0],
) else {
panic!("valid system should construct");
};
assert_eq!(system.is_equilibrium(0.0), Some(true));Trait Implementations§
§impl Clone for StaticSystem2D
impl Clone for StaticSystem2D
§fn clone(&self) -> StaticSystem2D
fn clone(&self) -> StaticSystem2D
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for StaticSystem2D
impl Debug for StaticSystem2D
§impl PartialEq for StaticSystem2D
impl PartialEq for StaticSystem2D
impl StructuralPartialEq for StaticSystem2D
Auto Trait Implementations§
impl Freeze for StaticSystem2D
impl RefUnwindSafe for StaticSystem2D
impl Send for StaticSystem2D
impl Sync for StaticSystem2D
impl Unpin for StaticSystem2D
impl UnsafeUnpin for StaticSystem2D
impl UnwindSafe for StaticSystem2D
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