Matrix Class (Singular or Orthogonal)

Learn to evaluate whether a given matrix is singular or orthogonal.

We'll cover the following

Problem

Write a program to check whether a 3 x 3 matrix is a singularA singular matrix refers to a matrix whose determinant is zero. or an orthogonalWhen the product of a square matrix and its transpose gives an identity matrix, then the square matrix is known as an orthogonal matrix. matrix.

Sample run

Here’s what you should see when you run the program.

Enter elements for first array: 

Enter the element: 1
Enter the element: 0
Enter the element: 0
Enter the element: 0
Enter the element: 1
Enter the element: 0
Enter the element: 0
Enter the element: 0
Enter the element: 1

The Matrix: 
1  0  0  
0  1  0  
0  0  1  

The determinant for the given matrix: 1
mat1 matrix is not singular
mat1 matrix is orthogonal

Coding solution

Here is a solution to the problem above.

Get hands-on with 1400+ tech skills courses.