pub struct AngularState {
pub angular_position: f64,
pub angular_velocity: f64,
}Expand description
A scalar angular position and angular velocity pair.
Fields§
§angular_position: f64§angular_velocity: f64Implementations§
Source§impl AngularState
impl AngularState
Sourcepub const fn new(angular_position: f64, angular_velocity: f64) -> Option<Self>
pub const fn new(angular_position: f64, angular_velocity: f64) -> Option<Self>
Creates an angular state when both values are finite.
Sourcepub fn advanced_by_constant_acceleration(
&self,
angular_acceleration: f64,
time: f64,
) -> Option<Self>
pub fn advanced_by_constant_acceleration( &self, angular_acceleration: f64, time: f64, ) -> Option<Self>
Advances the state under constant angular acceleration.
§Examples
use use_rotation::AngularState;
let next = AngularState::new(1.0, 2.0)
.unwrap()
.advanced_by_constant_acceleration(3.0, 4.0)
.unwrap();
assert_eq!(
next,
AngularState {
angular_position: 33.0,
angular_velocity: 14.0,
}
);Trait Implementations§
Source§impl Clone for AngularState
impl Clone for AngularState
Source§fn clone(&self) -> AngularState
fn clone(&self) -> AngularState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AngularState
impl Debug for AngularState
Source§impl PartialEq for AngularState
impl PartialEq for AngularState
Source§fn eq(&self, other: &AngularState) -> bool
fn eq(&self, other: &AngularState) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for AngularState
impl StructuralPartialEq for AngularState
Auto Trait Implementations§
impl Freeze for AngularState
impl RefUnwindSafe for AngularState
impl Send for AngularState
impl Sync for AngularState
impl Unpin for AngularState
impl UnsafeUnpin for AngularState
impl UnwindSafe for AngularState
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