Struct lowdim::Vec3d [−][src]
Expand description
A 3d discrete vector.
Implementations
Returns true if the vector points towards positive x.
That is, among the vectors pointing in both directions along the coordinate axes, the one pointing towards positive x is closest to this vector. Or to put it more concretely, the x coordinate of the vector is positive, and its absolute value is greater than that of the other coordinates.
Examples
use lowdim::v3d;
let v = v3d(3, 2, -1);
assert!(v.is_towards_pos_x());
let v = v3d(3, -2, -1);
assert!(v.is_towards_pos_x());
let v = v3d(-3, -2, -1);
assert!(!v.is_towards_pos_x());
let v = v3d(3, 2, -3);
assert!(!v.is_towards_pos_x());Returns true if the vector points towards negative x.
That is, among the vectors pointing in both directions along the coordinate axes, the one pointing towards negative x is closest to this vector. Or to put it more concretely, the x coordinate of the vector is negative, and its absolute value is greater than that of the other coordinates.
Examples
let v = v3d(-3, 2, -1);
assert!(v.is_towards_neg_x());Returns true if the vector points towards positive y.
See Vec3d::is_towards_pos_x for more details.
Examples
let v = v3d(2, 3, -1);
assert!(v.is_towards_pos_y());Returns true if the vector points towards negative y.
See Vec3d::is_towards_neg_x for more details.
Examples
let v = v3d(2, -3, -1);
assert!(v.is_towards_neg_y());Returns true if the vector points towards positive z.
See Vec3d::is_towards_pos_x for more details.
Examples
let v = v3d(2, -3, 4);
assert!(v.is_towards_pos_z());Returns true if the vector points towards negative z.
See Vec3d::is_towards_neg_x for more details.
Examples
let v = v3d(2, -3, -4);
assert!(v.is_towards_neg_z());Trait Implementations
Performs the += operation. Read more
Performs the += operation. Read more
Creates a value from an iterator. Read more
Performs the -= operation. Read more
Performs the -= operation. Read more
Returns a slice containing the coordinates of the vector.
Returns a mutable slice containing the coordinates of the vector.
Returns the L1 norm of the vector.
This is also called the taxicab, Manhatten or city block norm.
Returns the L∞ norm of the vector.
This is also called the maximum or Chebychev norm.
Returns the square of the L2-norm of the vector.
The L2-norm is also called the Euclidean norm and is the standard notion of the length of a vector.
type DefaultLayout = Layout3d<S>
type DefaultLayout = Layout3d<S>
The default layout to use with this vector.
Create a vector from a function which computes the coordinates. Read more
Returns the partial ordering by component of two vectors.
Returns the lexicographic total ordering for this and another vector. Read more
Returns an iterator that yields the unit vectors.
fn unit_vecs_l1() -> UnitVecsL1<S, Self>ⓘNotable traits for UnitVecsL1<S, V>impl<S, V> Iterator for UnitVecsL1<S, V> where
S: Integer,
V: Vector<S>, type Item = V;
fn unit_vecs_l1() -> UnitVecsL1<S, Self>ⓘNotable traits for UnitVecsL1<S, V>impl<S, V> Iterator for UnitVecsL1<S, V> where
S: Integer,
V: Vector<S>, type Item = V;
impl<S, V> Iterator for UnitVecsL1<S, V> where
S: Integer,
V: Vector<S>, type Item = V;Returns an iterator that yields the vectors to orthogonal neighbours. Read more
fn unit_vecs_l_infty() -> UnitVecsLInfty<S, Self>ⓘNotable traits for UnitVecsLInfty<S, V>impl<S, V> Iterator for UnitVecsLInfty<S, V> where
S: Integer,
V: Vector<S>, type Item = V;
fn unit_vecs_l_infty() -> UnitVecsLInfty<S, Self>ⓘNotable traits for UnitVecsLInfty<S, V>impl<S, V> Iterator for UnitVecsLInfty<S, V> where
S: Integer,
V: Vector<S>, type Item = V;
impl<S, V> Iterator for UnitVecsLInfty<S, V> where
S: Integer,
V: Vector<S>, type Item = V;Creates a vector of the vectors with L∞ norm equal to 1. Read more
Auto Trait Implementations
impl<S> RefUnwindSafe for Vec3d<S> where
S: RefUnwindSafe,
impl<S> UnwindSafe for Vec3d<S> where
S: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
