Add Vector::ith_axis to build an unit vector with its i-th component set to 1.
This commit is contained in:
parent
55689c238a
commit
9c93a58b5d
|
@ -1019,6 +1019,12 @@ where
|
|||
res
|
||||
}
|
||||
|
||||
/// The column unit vector with `N::one()` as its i-th component.
|
||||
#[inline]
|
||||
pub fn ith_axis(i: usize) -> Unit<Self> {
|
||||
Unit::new_unchecked(Self::ith(i, N::one()))
|
||||
}
|
||||
|
||||
/// The column vector with a 1 as its first component, and zero elsewhere.
|
||||
#[inline]
|
||||
pub fn x() -> Self
|
||||
|
|
Loading…
Reference in New Issue