[][src]Struct bcar::Pose

pub struct Pose {
    pub x: f64,
    pub y: f64,
    pub h: f64,
}

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: f64

Implementations

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 rotate(&mut self, p: Point, a: f64)[src]

Rotate self around p by a.

Arguments

  • p -- Point to rotate self around.
  • a -- Angle to rotate self by.

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

impl Send for Pose

impl Sync for Pose

impl Unpin for Pose

impl UnwindSafe for Pose

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.