pub struct Matrix3x2 {
pub e11: f64,
pub e12: f64,
pub e21: f64,
pub e22: f64,
pub e31: f64,
pub e32: f64,
}Expand description
A struct representing a 3x2 matrix.
This struct is used to store the transformation matrix for transforming a 2D vector into a 3D vector.
Namely, it is used in the transform_pqw_vector
method to tilt a 2D position into 3D, using the orbital parameters.
Each element is named eXY, where X is the row and Y is the column.
§Example
use glam::{DVec2, DVec3};
use keplerian_sim::Matrix3x2;
let matrix = Matrix3x2 {
e11: 1.0, e12: 0.0,
e21: 0.0, e22: 1.0,
e31: 0.0, e32: 0.0,
};
let vec = DVec2::new(1.0, 2.0);
let result = matrix.dot_vec(vec);
assert_eq!(result, DVec3::new(1.0, 2.0, 0.0));Fields§
§e11: f64§e12: f64§e21: f64§e22: f64§e31: f64§e32: f64Implementations§
Source§impl Matrix3x2
impl Matrix3x2
Sourcepub fn dot_vec(&self, vec: DVec2) -> DVec3
pub fn dot_vec(&self, vec: DVec2) -> DVec3
Computes a dot product between this matrix and a 2D vector.
§Example
use glam::{DVec2, DVec3};
use keplerian_sim::Matrix3x2;
let matrix = Matrix3x2 {
e11: 1.0, e12: 0.0,
e21: 0.0, e22: 1.0,
e31: 1.0, e32: 1.0,
};
let vec = DVec2::new(1.0, 2.0);
let result = matrix.dot_vec(vec);
assert_eq!(result, DVec3::new(1.0, 2.0, 3.0));Trait Implementations§
impl Copy for Matrix3x2
impl StructuralPartialEq for Matrix3x2
Auto Trait Implementations§
impl Freeze for Matrix3x2
impl RefUnwindSafe for Matrix3x2
impl Send for Matrix3x2
impl Sync for Matrix3x2
impl Unpin for Matrix3x2
impl UnwindSafe for Matrix3x2
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more