Debian Codegraph @

debian/missing-sources/glam-0.23.0/src/f64/dmat2.rs

raw symbols SCIP
1 // Generated from mat.rs.tera template. Edit the template, not the generated file.
2
3 use craterust-analyzer cargo glam 0.23.0 crate/::{swizzlesrust-analyzer cargo glam 0.23.0 swizzles/::*, DMat3rust-analyzer cargo glam 0.23.0 f64/dmat3/DMat3#, DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#, Mat2rust-analyzer cargo glam 0.23.0 f32/sse2/mat2/Mat2#};
4 #[cfg(not(target_arch = "spirv"))]
5 use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/;
6 use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/::{Productrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Product#, Sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Sum#};
7 use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::opsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/::{Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#, AddAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#, Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#, MulAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#, Negrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg#, Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#, SubAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign#};
8
9 #[cfg(feature = "libm")]
10 #[allow(unused_imports)]
11 use num_traits::Float;
12
13 /// Creates a 2x2 matrix from column vectors.
14 #[inline(always)]
15 pub const fn dmat2rust-analyzer cargo glam 0.23.0 f64/dmat2/dmat2().(x_axis: DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#, y_axis: DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#) -> DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
16 DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#::from_colsrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_cols().(x_axis, y_axis)
17 }
18
19 /// A 2x2 column major matrix.
20 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:, Copyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Copy:)]
21 #[cfg_attr(feature = "cuda", repr(align(16)))]
22 #[repr(C)]
23 pub struct DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
24 pub x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis.: DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#,
25 pub y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis.: DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#,
26 }
27
28 impl DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
29 /// A 2x2 matrix with all elements set to `0.0`.
30 pub const ZEROrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]ZERO.: Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] = Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]::from_colsrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_cols().(DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#::ZEROrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]ZERO., DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#::ZEROrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]ZERO.);
31
32 /// A 2x2 identity matrix, where all diagonal elements are `1`, and all off-diagonal elements are `0`.
33 pub const IDENTITYrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]IDENTITY.: Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] = Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]::from_colsrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_cols().(DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#::Xrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]X., DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#::Yrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]Y.);
34
35 /// All NAN:s.
36 pub const NANrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]NAN.: Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] = Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]::from_colsrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_cols().(DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#::NANrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]NAN., DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#::NANrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]NAN.);
37
38 #[allow(clippy::too_many_arguments)]
39 #[inline(always)]
40 const fn newrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]new().(m00: f64, m01: f64, m10: f64, m11: f64) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] {
41 Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] {
42 x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis.: DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#::newrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]new().(m00, m01),
43 y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis.: DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#::newrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]new().(m10, m11),
44 }
45 }
46
47 /// Creates a 2x2 matrix from two column vectors.
48 #[inline(always)]
49 pub const fn from_colsrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_cols().(x_axis: DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#, y_axis: DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] {
50 Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] { x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis., y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis. }
51 }
52
53 /// Creates a 2x2 matrix from a `[f64; 4]` array stored in column major order.
54 /// If your data is stored in row major you will need to `transpose` the returned
55 /// matrix.
56 #[inline]
57 pub const fn from_cols_arrayrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_cols_array().(m: &[f64; 4]) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] {
58 Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]::newrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]new().(m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().3]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().)
59 }
60
61 /// Creates a `[f64; 4]` array storing data in column major order.
62 /// If you require data in row major order `transpose` the matrix first.
63 #[inline]
64 pub const fn to_cols_arrayrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]to_cols_array().(&self) -> [f64; 4] {
65 [self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x., self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y., self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x., self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y.]
66 }
67
68 /// Creates a 2x2 matrix from a `[[f64; 2]; 2]` 2D array stored in column major order.
69 /// If your data is in row major order you will need to `transpose` the returned
70 /// matrix.
71 #[inline]
72 pub const fn from_cols_array_2drust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_cols_array_2d().(m: &[[f64; 2]; 2]) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] {
73 Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]::from_colsrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_cols().(DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#::from_arrayrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]from_array().(m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().), DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#::from_arrayrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]from_array().(m[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().))
74 }
75
76 /// Creates a `[[f64; 2]; 2]` 2D array storing data in column major order.
77 /// If you require data in row major order `transpose` the matrix first.
78 #[inline]
79 pub const fn to_cols_array_2drust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]to_cols_array_2d().(&self) -> [[f64; 2]; 2] {
80 [self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..to_arrayrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]to_array().(), self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..to_arrayrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]to_array().()]
81 }
82
83 /// Creates a 2x2 matrix with its diagonal set to `diagonal` and all other entries set to 0.
84 #[doc(alias = "scale")]
85 #[inline]
86 pub const fn from_diagonalrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_diagonal().(diagonal: DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] {
87 Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]::newrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]new().(diagonal.xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x., 0.0, 0.0, diagonal.yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y.)
88 }
89
90 /// Creates a 2x2 matrix containing the combining non-uniform `scale` and rotation of
91 /// `angle` (in radians).
92 #[inline]
93 pub fn from_scale_anglerust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_scale_angle().(scale: DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#, angle: f64) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] {
94 let (sin, cos) = angle.sin_cosrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f64/impl#[f64]sin_cos().();
95 Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]::newrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]new().(cos rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().scale.xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x., sin rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().scale.xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x., -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][Neg]neg().sin rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().scale.yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y., cos rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().scale.yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y.)
96 }
97
98 /// Creates a 2x2 matrix containing a rotation of `angle` (in radians).
99 #[inline]
100 pub fn from_anglerust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_angle().(angle: f64) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] {
101 let (sin, cos) = angle.sin_cosrust-analyzer cargo std https://github.com/rust-lang/rust/library/std f64/impl#[f64]sin_cos().();
102 Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]::newrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]new().(cos, sin, -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][Neg]neg().sin, cos)
103 }
104
105 /// Creates a 2x2 matrix from a 3x3 matrix, discarding the 2nd row and column.
106 #[inline]
107 pub fn from_mat3rust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_mat3().(m: DMat3rust-analyzer cargo glam 0.23.0 f64/dmat3/DMat3#) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] {
108 Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]::from_colsrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_cols().(m.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat3/DMat3#x_axis..xyrust-analyzer cargo glam 0.23.0 swizzles/dvec3_impl/impl#[DVec3][Vec3Swizzles]xy().(), m.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat3/DMat3#y_axis..xyrust-analyzer cargo glam 0.23.0 swizzles/dvec3_impl/impl#[DVec3][Vec3Swizzles]xy().())
109 }
110
111 /// Creates a 2x2 matrix from the first 4 values in `slice`.
112 ///
113 /// # Panics
114 ///
115 /// Panics if `slice` is less than 4 elements long.
116 #[inline]
117 pub const fn from_cols_slicerust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_cols_slice().(slice: &[f64]) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] {
118 Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]::newrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]new().(slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index()., slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().3]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/Index#index().)
119 }
120
121 /// Writes the columns of `self` to the first 4 elements in `slice`.
122 ///
123 /// # Panics
124 ///
125 /// Panics if `slice` is less than 4 elements long.
126 #[inline]
127 pub fn write_cols_to_slicerust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]write_cols_to_slice().(self, slice: &mut [f64]) {
128 slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().0]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x.;
129 slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().1]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y.;
130 slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().2]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x.;
131 slice[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut().3]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/index/IndexMut#index_mut(). = self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y.;
132 }
133
134 /// Returns the matrix column for the given `index`.
135 ///
136 /// # Panics
137 ///
138 /// Panics if `index` is greater than 1.
139 #[inline]
140 pub fn colrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]col().(&self, index: usize) -> DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2# {
141 match index {
142 0 => self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis.,
143 1 => self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis.,
144 _ => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("index out of bounds"),
145 }
146 }
147
148 /// Returns a mutable reference to the matrix column for the given `index`.
149 ///
150 /// # Panics
151 ///
152 /// Panics if `index` is greater than 1.
153 #[inline]
154 pub fn col_mutrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]col_mut().(&mut self, index: usize) -> &mut DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2# {
155 match index {
156 0 => &mut self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis.,
157 1 => &mut self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis.,
158 _ => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("index out of bounds"),
159 }
160 }
161
162 /// Returns the matrix row for the given `index`.
163 ///
164 /// # Panics
165 ///
166 /// Panics if `index` is greater than 1.
167 #[inline]
168 pub fn rowrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]row().(&self, index: usize) -> DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2# {
169 match index {
170 0 => DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#::newrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]new().(self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x., self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x.),
171 1 => DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#::newrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]new().(self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y., self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y.),
172 _ => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("index out of bounds"),
173 }
174 }
175
176 /// Returns `true` if, and only if, all elements are finite.
177 /// If any element is either `NaN`, positive or negative infinity, this will return `false`.
178 #[inline]
179 pub fn is_finiterust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]is_finite().(&self) -> bool {
180 self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..is_finiterust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]is_finite().() && self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..is_finiterust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]is_finite().()
181 }
182
183 /// Returns `true` if any elements are `NaN`.
184 #[inline]
185 pub fn is_nanrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]is_nan().(&self) -> bool {
186 self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..is_nanrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]is_nan().() || self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..is_nanrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]is_nan().()
187 }
188
189 /// Returns the transpose of `self`.
190 #[must_use]
191 #[inline]
192 pub fn transposerust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]transpose().(&self) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] {
193 Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] {
194 x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis.: DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#::newrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]new().(self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x., self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x.),
195 y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis.: DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#::newrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]new().(self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y., self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y.),
196 }
197 }
198
199 /// Returns the determinant of `self`.
200 #[inline]
201 pub fn determinantrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]determinant().(&self) -> f64 {
202 self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Sub<Self>`]sub().self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x.
203 }
204
205 /// Returns the inverse of `self`.
206 ///
207 /// If the matrix is not invertible the returned matrix will be invalid.
208 ///
209 /// # Panics
210 ///
211 /// Will panic if the determinant of `self` is zero when `glam_assert` is enabled.
212 #[must_use]
213 #[inline]
214 pub fn inverserust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]inverse().(&self) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] {
215 let inv_det = {
216 let det = self.determinantrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]determinant().();
217 glam_assertrust-analyzer cargo glam 0.23.0 macros/glam_assert!!(det != 0.0);
218 det.reciprust-analyzer cargo core https://github.com/rust-lang/rust/library/core f64/impl#[f64]recip().()
219 };
220 Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]::newrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]new().(
221 self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().inv_det,
222 self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][Neg]neg().inv_det,
223 self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][Neg]neg().inv_det,
224 self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().inv_det,
225 )
226 }
227
228 /// Transforms a 2D vector.
229 #[inline]
230 pub fn mul_vec2rust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]mul_vec2().(&self, rhs: DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#) -> DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2# {
231 #[allow(clippy::suspicious_operation_groupings)]
232 DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#::newrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]new().(
233 (self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().rhs.xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x.) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Add<Self>`]add().(self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().rhs.yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y.),
234 (self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().rhs.xrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#x.) rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Add<Self>`]add().(self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul().rhs.yrust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#y.),
235 )
236 }
237
238 /// Multiplies two 2x2 matrices.
239 #[inline]
240 pub fn mul_mat2rust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]mul_mat2().(&self, rhs: &Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] {
241 Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]::from_colsrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_cols().(self.mulrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Mul<DVec2>`]mul().(rhs.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis.), self.mulrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Mul<DVec2>`]mul().(rhs.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis.))
242 }
243
244 /// Adds two 2x2 matrices.
245 #[inline]
246 pub fn add_mat2rust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]add_mat2().(&self, rhs: &Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] {
247 Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]::from_colsrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_cols().(self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..addrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2][`Add<Self>`]add().(rhs.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis.), self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..addrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2][`Add<Self>`]add().(rhs.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis.))
248 }
249
250 /// Subtracts two 2x2 matrices.
251 #[inline]
252 pub fn sub_mat2rust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]sub_mat2().(&self, rhs: &Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] {
253 Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]::from_colsrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_cols().(self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..subrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2][`Sub<Self>`]sub().(rhs.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis.), self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..subrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2][`Sub<Self>`]sub().(rhs.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis.))
254 }
255
256 /// Multiplies a 2x2 matrix by a scalar.
257 #[inline]
258 pub fn mul_scalarrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]mul_scalar().(&self, rhs: f64) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2] {
259 Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]::from_colsrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_cols().(self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..mulrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2][`Mul<f64>`]mul().(rhs), self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..mulrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2][`Mul<f64>`]mul().(rhs))
260 }
261
262 /// Returns true if the absolute difference of all elements between `self` and `rhs`
263 /// is less than or equal to `max_abs_diff`.
264 ///
265 /// This can be used to compare if two matrices contain similar elements. It works best
266 /// when comparing with a known value. The `max_abs_diff` that should be used used
267 /// depends on the values being compared against.
268 ///
269 /// For more see
270 /// [comparing floating point numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/).
271 #[inline]
272 pub fn abs_diff_eqrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]abs_diff_eq().(&self, rhs: Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2], max_abs_diff: f64) -> bool {
273 self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..abs_diff_eqrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]abs_diff_eq().(rhs.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis., max_abs_diff)
274 && self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..abs_diff_eqrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]abs_diff_eq().(rhs.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis., max_abs_diff)
275 }
276
277 #[inline]
278 pub fn as_mat2rust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]as_mat2().(&self) -> Mat2rust-analyzer cargo glam 0.23.0 f32/sse2/mat2/Mat2# {
279 Mat2rust-analyzer cargo glam 0.23.0 f32/sse2/mat2/Mat2#::from_colsrust-analyzer cargo glam 0.23.0 f32/sse2/mat2/impl#[Mat2]from_cols().(self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..as_vec2rust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]as_vec2().(), self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..as_vec2rust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2]as_vec2().())
280 }
281 }
282
283 impl Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default# for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
284 #[inline]
285 fn defaultrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][Default]default().() -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][Default] {
286 Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][Default]::IDENTITYrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]IDENTITY.
287 }
288 }
289
290 impl Addrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#<DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#> for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
291 type Outputrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Add<Self>`]Output# = Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Add<Self>`];
292 #[inline]
293 fn addrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Add<Self>`]add().(self, rhs: Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Add<Self>`]) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Add<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Add#Output# {
294 self.add_mat2rust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]add_mat2().(&rhs)
295 }
296 }
297
298 impl AddAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/AddAssign#<DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#> for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
299 #[inline]
300 fn add_assignrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`AddAssign<Self>`]add_assign().(&mut self, rhs: Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`AddAssign<Self>`]) {
301 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = self.add_mat2rust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]add_mat2().(&rhs);
302 }
303 }
304
305 impl Subrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#<DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#> for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
306 type Outputrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Sub<Self>`]Output# = Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Sub<Self>`];
307 #[inline]
308 fn subrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Sub<Self>`]sub().(self, rhs: Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Sub<Self>`]) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Sub<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Sub#Output# {
309 self.sub_mat2rust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]sub_mat2().(&rhs)
310 }
311 }
312
313 impl SubAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/SubAssign#<DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#> for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
314 #[inline]
315 fn sub_assignrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`SubAssign<Self>`]sub_assign().(&mut self, rhs: Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`SubAssign<Self>`]) {
316 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = self.sub_mat2rust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]sub_mat2().(&rhs);
317 }
318 }
319
320 impl Negrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg# for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
321 type Outputrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][Neg]Output# = Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][Neg];
322 #[inline]
323 fn negrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][Neg]neg().(self) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][Neg]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Neg#Output# {
324 Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][Neg]::from_colsrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]from_cols().(self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..negrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2][Neg]neg().(), self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..negrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2][Neg]neg().())
325 }
326 }
327
328 impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#> for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
329 type Outputrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Mul<Self>`]Output# = Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Mul<Self>`];
330 #[inline]
331 fn mulrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Mul<Self>`]mul().(self, rhs: Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Mul<Self>`]) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Mul<Self>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# {
332 self.mul_mat2rust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]mul_mat2().(&rhs)
333 }
334 }
335
336 impl MulAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#<DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#> for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
337 #[inline]
338 fn mul_assignrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`MulAssign<Self>`]mul_assign().(&mut self, rhs: Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`MulAssign<Self>`]) {
339 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = self.mul_mat2rust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]mul_mat2().(&rhs);
340 }
341 }
342
343 impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#> for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
344 type Outputrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Mul<DVec2>`]Output# = DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#;
345 #[inline]
346 fn mulrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Mul<DVec2>`]mul().(self, rhs: DVec2rust-analyzer cargo glam 0.23.0 f64/dvec2/DVec2#) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Mul<DVec2>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# {
347 self.mul_vec2rust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]mul_vec2().(rhs)
348 }
349 }
350
351 impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#> for f64 {
352 type Outputrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[f64][`Mul<DMat2>`]Output# = DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#;
353 #[inline]
354 fn mulrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[f64][`Mul<DMat2>`]mul().(self, rhs: DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[f64][`Mul<DMat2>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# {
355 rhs.mul_scalarrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]mul_scalar().(self)
356 }
357 }
358
359 impl Mulrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#<f64> for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
360 type Outputrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Mul<f64>`]Output# = Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Mul<f64>`];
361 #[inline]
362 fn mulrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Mul<f64>`]mul().(self, rhs: f64) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Mul<f64>`]::Outputrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/Mul#Output# {
363 self.mul_scalarrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]mul_scalar().(rhs)
364 }
365 }
366
367 impl MulAssignrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/MulAssign#<f64> for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
368 #[inline]
369 fn mul_assignrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`MulAssign<f64>`]mul_assign().(&mut self, rhs: f64) {
370 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().self = self.mul_scalarrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]mul_scalar().(rhs);
371 }
372 }
373
374 impl Sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Sum#<Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Sum<Self>`]> for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
375 fn sumrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Sum<Self>`]sum().<I>(iter: I) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Sum<Self>`]
376 where
377 I: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Sum<Self>`]>,
378 {
379 iter.foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fold().(Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Sum<Self>`]::ZEROrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]ZERO., Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Sum<Self>`]::addrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Add<Self>`]add().)
380 }
381 }
382
383 impl<'a> Sumrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Sum#<&'a Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Sum<&'a DMat2>`]> for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
384 fn sumrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Sum<&'a DMat2>`]sum().<I>(iter: I) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Sum<&'a DMat2>`]
385 where
386 I: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = &'a Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Sum<&'a DMat2>`]>,
387 {
388 iter.foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fold().(Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Sum<&'a DMat2>`]::ZEROrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]ZERO., |a, &b| Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Sum<&'a DMat2>`]::addrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Add<Self>`]add().(a, b))
389 }
390 }
391
392 impl Productrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Product# for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
393 fn productrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Product<Self>`]product().<I>(iter: I) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Product<Self>`]
394 where
395 I: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Product<Self>`]>,
396 {
397 iter.foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fold().(Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Product<Self>`]::IDENTITYrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]IDENTITY., Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Product<Self>`]::mulrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Mul<Self>`]mul().)
398 }
399 }
400
401 impl<'a> Productrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/accum/Product#<&'a Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Product<&'a DMat2>`]> for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
402 fn productrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Product<&'a DMat2>`]product().<I>(iter: I) -> Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Product<&'a DMat2>`]
403 where
404 I: Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = &'a Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Product<&'a DMat2>`]>,
405 {
406 iter.foldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#fold().(Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Product<&'a DMat2>`]::IDENTITYrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2]IDENTITY., |a, &b| Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Product<&'a DMat2>`]::mulrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`Mul<Self>`]mul().(a, b))
407 }
408 }
409
410 impl PartialEqrust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/PartialEq# for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
411 #[inline]
412 fn eqrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`PartialEq<Self>`]eq().(&self, rhs: &Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`PartialEq<Self>`]) -> bool {
413 self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis..eqrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2][`PartialEq<Self>`]eq().(&rhs.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis.) && self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis..eqrust-analyzer cargo glam 0.23.0 f64/dvec2/impl#[DVec2][`PartialEq<Self>`]eq().(&rhs.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis.)
414 }
415 }
416
417 #[cfg(not(target_arch = "spirv"))]
418 impl AsRefrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsRef#<[f64; 4]> for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
419 #[inline]
420 fn as_refrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`AsRef<[f64; 4]>`]as_ref().(&self) -> &[f64; 4] {
421 unsafe { &*rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#deref().(self as *const Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`AsRef<[f64; 4]>`] as *const [f64; 4]) }
422 }
423 }
424
425 #[cfg(not(target_arch = "spirv"))]
426 impl AsMutrust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/AsMut#<[f64; 4]> for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
427 #[inline]
428 fn as_mutrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`AsMut<[f64; 4]>`]as_mut().(&mut self) -> &mut [f64; 4] {
429 unsafe { &mut *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/Deref#deref().(self as *mut Selfrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][`AsMut<[f64; 4]>`] as *mut [f64; 4]) }
430 }
431 }
432
433 #[cfg(not(target_arch = "spirv"))]
434 impl fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Debug# for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
435 fn fmtrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][Debug]fmt().(&self, fmt: &mut fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
436 fmt.debug_structrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/impl#[`Formatter<'a>`]debug_struct().(stringifyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/stringify!!(DMat2))
437 .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("x_axis", &self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis.)
438 .fieldrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]field().("y_axis", &self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis.)
439 .finishrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/builders/impl#[`DebugStruct<'a, 'b>`]finish().()
440 }
441 }
442
443 #[cfg(not(target_arch = "spirv"))]
444 impl fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Displayrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Display# for DMat2rust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2# {
445 fn fmtrust-analyzer cargo glam 0.23.0 f64/dmat2/impl#[DMat2][Display]fmt().(&self, f: &mut fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Formatterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Formatter#<'_>) -> fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Result# {
446 writerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/write!!(f, "[{}, {}]", self.x_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#x_axis., self.y_axisrust-analyzer cargo glam 0.23.0 f64/dmat2/DMat2#y_axis.)
447 }
448 }