pub struct Pendulum {
pub(crate) nitems: usize,
pub(crate) poss: Vec<f64>,
pub(crate) vels: Vec<f64>,
pub(crate) dt: f64,
}
Expand description
Stores the state of the pendulum.
Fields§
§nitems: usize
Number of mass points.
poss: Vec<f64>
Angles.
vels: Vec<f64>
Angular velocities.
dt: f64
Time step size, which is used as a reference to decide the next value.
Implementations§
source§impl Pendulum
impl Pendulum
Getters.
sourcepub fn get_nitems(&self) -> usize
pub fn get_nitems(&self) -> usize
Getter, number of items.
sourcepub fn get_positions(&self) -> &Vec<f64>
pub fn get_positions(&self) -> &Vec<f64>
Getter, positions (angles).
sourcepub fn get_velocities(&self) -> &Vec<f64>
pub fn get_velocities(&self) -> &Vec<f64>
Getter, (angular) velocities.
Auto Trait Implementations§
impl RefUnwindSafe for Pendulum
impl Send for Pendulum
impl Sync for Pendulum
impl Unpin for Pendulum
impl UnwindSafe for Pendulum
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