Struct bcar::Pose [−][src]
Basic pose geometry.
Examples
let pose = bcar::Pose::new(1.0, 2.0, 3.0); assert_eq!(1.0, pose.x); assert_eq!(2.0, pose.y); assert_eq!(3.0, pose.h);
Fields
x: f64y: f64h: f64Implementations
impl Pose[src]
pub fn new(x: f64, y: f64, h: f64) -> Pose[src]
pub fn default() -> Pose[src]
Return default pose.
Examples
let pose = bcar::Pose::default(); assert_eq!(pose, bcar::Pose::new(0.0, 0.0, 0.0));
pub fn point(&self) -> Point[src]
Return Point from pose.
pub fn rotate(&mut self, p: Point, a: f64)[src]
Rotate self around p by a.
Arguments
p-- Point to rotateselfaround.a-- Angle to rotateselfby.
Examples
let mut pose = bcar::Pose::new(0.0, 0.0, 0.0); pose.rotate(bcar::Point::new(-1.0, 0.0), std::f64::consts::PI); assert!(pose.x - -2.0 < 0.00001); assert!(pose.y - 0.0 < 0.00001); assert!(pose.h - std::f64::consts::PI < 0.00001);
Trait Implementations
impl Clone for Pose[src]
impl Copy for Pose[src]
impl Debug for Pose[src]
impl PartialEq<Pose> for Pose[src]
impl StructuralPartialEq for Pose[src]
Auto Trait Implementations
impl RefUnwindSafe for Pose[src]
impl Send for Pose[src]
impl Sync for Pose[src]
impl Unpin for Pose[src]
impl UnwindSafe for Pose[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,