Oleksii Trekhleb | Javascript algorithms (Matrices)

This is a series of books diving deep into the core mechanisms of the JavaScript language.

 · 2 phút đọc.

This is a series of books diving deep into the core mechanisms of the JavaScript language.

In mathematics, a matrix (plural matrices) is a rectangular array or table of numbers, symbols, or expressions, arranged in rows and columns. For example, the dimension of the matrix below is 2 × 3 (read two by three), because there are two rows and three columns:

| 1  9 -13 |
| 20 5 -6  |

An m × n matrix

An m × n matrix: the m rows are horizontal, and the n columns are vertical. Each element of a matrix is often denoted by a variable with two subscripts. For example, a2,1 represents the element at the second row and first column of the matrix

Operations on matrices

Addition

To add two matrices: add the numbers in the matching positions:

Matrices addition

The two matrices must be the same size, i.e. the rows must match in size, and the columns must match in size.

Subtracting

To subtract two matrices: subtract the numbers in the matching positions:

Matrices subtraction

Multiply by a Constant

We can multiply a matrix by a constant (the value 2 in this case):

Matrices multiplication be a constant

Multiplying by Another Matrix

To multiply a matrix by another matrix we need to do the dot product of rows and columns.

To work out the answer for the 1st row and 1st column:

Matrices multiplication - 1st step

Here it is for the 1st row and 2nd column:

Matrices multiplication - 2st step

If we’ll do the same for the rest of the rows and columns we’ll get the following resulting matrix:

Matrices multiplication - Result

Transposing

To transpose a matrix, swap the rows and columns.

We put a T in the top right-hand corner to mean transpose:

Transposing

nhavantuonglai

Share:
Quay lại.

Có thể bạn chưa đọc

Xem tất cả »

Đăng ký nhận bảng tin hàng tuần

Liên lạc trao đổi

Liên lạc thông qua Instagram

Thông qua Instagram, bạn có thể trao đổi trực tiếp và tức thời, cũng như cập nhật những thông tin mới nhất từ nhavantuonglai.

Tức thời

Bạn có thể gửi và nhận tin nhắn nhanh chóng, trực tiếp, giúp những vấn đề cá nhân của bạn được giải quyết tức thời và hiệu quả hơn.

Thân thiện

Vì tính chất là kênh liên lạc nhanh, nên bạn có thể bỏ qua những nghi thức giao tiếp thông thường, chỉ cần lịch sự và tôn trọng thì sẽ nhận được sự phản hồi đầy thân thiện, thoải mái từ tác giả.

Trao đổi trên email

Thông qua email cá nhân, bạn có thể trao đổi thỏa thuận hợp tác, kết nối chuyên sâu và mang tính chuyên nghiệp.

Tin cậy

Trong một số trường hợp, email được dùng như một tài liệu pháp lý, chính vì vậy mà bạn có thể an tâm và tin cậy khi trao đổi với tác giả thông qua email.

Chuyên nghiệp

Cấu trúc của email đặt tính chuyên nghiệp lên hàng đầu, nên những thông tin, nội dung được viết trong email từ tác giả sẽ luôn đảm bảo điều này ở mức cao nhất.

nhavantuonglai · Ghiblis Music Piano Playlist