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: f64
y: f64
h: f64
Implementations
impl Pose
[src]
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 rotateself
around.a
– Angle to rotateself
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
Auto Trait Implementations
impl RefUnwindSafe for Pose
impl RefUnwindSafe for Pose
impl UnwindSafe for Pose
impl UnwindSafe for Pose