PetrovIliya / OOP

OOP
0 stars 0 forks source link

Замечания по программе Invert #3

Open alexey-malov opened 4 years ago

alexey-malov commented 4 years ago

https://github.com/PetrovIliya/OOP/blob/759ce4b4189ab7d53e1bbc12349b68819f9af02f/lw1/invert/invert.cpp#L162

alexey-malov commented 4 years ago

https://github.com/PetrovIliya/OOP/blob/759ce4b4189ab7d53e1bbc12349b68819f9af02f/lw1/invert/invert.cpp#L17-L25

alexey-malov commented 4 years ago

https://github.com/PetrovIliya/OOP/blob/759ce4b4189ab7d53e1bbc12349b68819f9af02f/lw1/invert/invert.cpp#L52-L55

alexey-malov commented 4 years ago

https://github.com/PetrovIliya/OOP/blob/759ce4b4189ab7d53e1bbc12349b68819f9af02f/lw1/invert/invert.cpp#L60-L69

alexey-malov commented 4 years ago

https://github.com/PetrovIliya/OOP/blob/759ce4b4189ab7d53e1bbc12349b68819f9af02f/lw1/invert/invert.cpp#L112

alexey-malov commented 4 years ago

https://github.com/PetrovIliya/OOP/blob/759ce4b4189ab7d53e1bbc12349b68819f9af02f/lw1/invert/invert.cpp#L207-L213

[[nodiscard]] bool Invert3x3Matrix(Matrix3x3 &matrix)
{
    float det = GetDeterminant3x3(matrix);
    if (det == 0)
    {
        return false;
        //throw std::logic_error("Determinant is zero. Inverted matrix do not exist");
    }
    TransposeMatrix(matrix);
    matrix = GetMinorMatrix(matrix);
    MultiplyMatrixByNumber(matrix, 1 / det);
    return true;
}
alexey-malov commented 4 years ago

input.txt