Scalar and VectorScalar and Vector Quantities are used to describe the motion of an object. Scalar Quantities are defined as physical quantities that have magnitude or size only. For example, distance, speed, mass, density, etc.However, vector quantities are those physical quantities that have both magnitude and dir
8 min read
Python Program to Multiply Two MatricesGiven two matrices, we will have to create a program to multiply two matrices in Python. Example: Python Matrix Multiplication of Two-DimensionPythonmatrix_a = [[1, 2], [3, 4]] matrix_b = [[5, 6], [7, 8]] result = [[0, 0], [0, 0]] for i in range(2): for j in range(2): result[i][j] = (matrix_a[i][0]
5 min read
Dot and Cross Products on VectorsA quantity that has both magnitude and direction is known as a vector. Various operations can be performed on such quantities, such as addition, subtraction, and multiplication (products) etc. Some examples of vector quantities are: velocity, force, acceleration, and momentum, etc.Vectors can be mul
9 min read
Transpose a matrix in Single line in PythonTransposing a matrix in Python means flipping it over its diagonal, turning all the rows into columns and all the columns into rows. For example, a matrix like [[1, 2], [3, 4], [5, 6]], which has 3 rows and 2 columns, becomes [[1, 3, 5], [2, 4, 6]], which has 2 rows and 3 columns after transposing.
3 min read
Program to find Normal and Trace of a matrixGiven a 2D matrix, the task is to find Trace and Normal of matrix.Normal of a matrix is defined as square root of sum of squares of matrix elements.Trace of a n x n square matrix is sum of diagonal elements. Examples : Input : mat[][] = {{7, 8, 9}, {6, 1, 2}, {5, 4, 3}}; Output : Normal = 16 Trace =
6 min read
How to compute the eigenvalues and right eigenvectors of a given square array using NumPY?In this article, we will discuss how to compute the eigenvalues and right eigenvectors of a given square array using NumPy library. Example: Suppose we have a matrix as: [[1,2], [2,3]] Eigenvalue we get from this matrix or square array is: [-0.23606798 4.23606798] Eigenvectors of this matrix are
2 min read