mod matOps;
mod vecOps;

use matOps::Matrix;
fn main() {
    println!("Hello, world!");
    let mut a = Matrix::zeros(2, 2);
    a.mat[0] = vec![-5f32, -7f32];
    a.mat[1] = vec![2., 4.];
    println!("{:?}", getEVals(a));
}

pub fn getEVals(m: Matrix) -> (f32, f32) {
    let trace = m.trace();
    let determinant = (m.mat[0][0] * m.mat[1][1]) - (m.mat[0][1] * m.mat[1][0]);
    let descriminant = trace.powi(2) - (4. * determinant);
    let x1 = (-trace + (descriminant.powf(0.5))) / 2.0;
    let x2 = (-trace - (descriminant.powf(0.5))) / 2.0;
    (x1, x2)
}
