Debian Codegraph @

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