pub struct Vector3 { /* private fields */ }
Expand description
A 3D vector.
Wrapper around C++ implementation maliput::math::Vector3
.
§Example
use maliput::math::Vector3;
let v = Vector3::new(1.0, 2.0, 3.0);
println!("v = {}", v);
assert_eq!(v.x(), 1.0);
assert_eq!(v.y(), 2.0);
assert_eq!(v.z(), 3.0);
assert_eq!(v.norm(), (1.0_f64.powi(2) + 2.0_f64.powi(2) + 3.0_f64.powi(2)).sqrt());
assert_eq!(v.dot(&v), 1.0_f64.powi(2) + 2.0_f64.powi(2) + 3.0_f64.powi(2));
assert_eq!(v.cross(&v), Vector3::new(0.0, 0.0, 0.0));
Implementations§
Trait Implementations§
impl Eq for Vector3
Auto Trait Implementations§
impl Freeze for Vector3
impl RefUnwindSafe for Vector3
impl !Send for Vector3
impl !Sync for Vector3
impl Unpin for Vector3
impl UnwindSafe for Vector3
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