#[repr(C)]pub struct Vec4<T>where
T: Scalar,{
pub x: T,
pub y: T,
pub z: T,
pub w: T,
}
Expand description
4D generic vector Implemented for f32, f64, i32
Fields§
§x: T
§y: T
§z: T
§w: T
Implementations§
Source§impl<T> Vec4<T>where
T: Scalar,
impl<T> Vec4<T>where
T: Scalar,
pub fn new(x: T, y: T, z: T, w: T) -> Vec4<T>
Sourcepub fn broadcast(a: T) -> Vec4<T>
pub fn broadcast(a: T) -> Vec4<T>
Constructs a new Vec4 from a scalar value by copying that value to all members
§Examples
// V4f32 is a type alias for Vec4::<f32>
use imath::vec::V4f32;
let v = V4f32::broadcast(1.0);
assert!(v.x == 1.0 && v.y == 1.0 && v.z == 1.0 && v.w == 1.0)
Sourcepub fn equal_with_abs_error(self, v: Vec4<T>, e: T) -> boolwhere
T: PartialOrd,
pub fn equal_with_abs_error(self, v: Vec4<T>, e: T) -> boolwhere
T: PartialOrd,
Returns true if self and v are equal with error no greater than e
Sourcepub fn equal_with_rel_error(self, v: Vec4<T>, e: T) -> boolwhere
T: Real,
pub fn equal_with_rel_error(self, v: Vec4<T>, e: T) -> boolwhere
T: Real,
Returns true if self and v are equal with error no greater than e
Trait Implementations§
Source§impl<T> PartialOrd for Vec4<T>where
T: Scalar + PartialOrd,
impl<T> PartialOrd for Vec4<T>where
T: Scalar + PartialOrd,
impl<T> Copy for Vec4<T>
impl<T> Eq for Vec4<T>
impl<T> StructuralPartialEq for Vec4<T>where
T: Scalar,
Auto Trait Implementations§
impl<T> Freeze for Vec4<T>where
T: Freeze,
impl<T> RefUnwindSafe for Vec4<T>where
T: RefUnwindSafe,
impl<T> Send for Vec4<T>where
T: Send,
impl<T> Sync for Vec4<T>where
T: Sync,
impl<T> Unpin for Vec4<T>where
T: Unpin,
impl<T> UnwindSafe for Vec4<T>where
T: UnwindSafe,
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