Trident Help

RPN Advanced 42 manual · Chapter 10 of 18

Matrices and vectors

Create, edit, invert and multiply matrices, solve linear systems, and use dot and cross products.

10.1The MATRIX menu#

Open MATRIX with shift 9. A matrix is one value on the stack, shown as [ 2×2 Matrix ]. You can store it in a register or a named variable. Entries are real numbers.

MATRIX page 1. The display shows: x: 0.0000 / NEW INV DET TRN SMQ EDT.
MATRIX page 1.
MATRIX page 2. The display shows: x: 0.0000 / DOT CRS UVC DIM     EDN.
MATRIX page 2.
LabelWhat it does
NEWMakes a zero matrix. Y = rows, X = columns.
INVInverse of the matrix in X.
DETDeterminant of the matrix in X.
TRNTranspose.
SMQSolve simultaneous equations (SIMQ).
EDTEdit the matrix in X.
DOT (page 2)Dot product of two vectors.
CRSCross product of two 3-element vectors.
UVCUnit vector: divides a vector by its length.
DIMCreates or resizes a named matrix (Y rows, X columns).
EDNEdits a named matrix.

10.2Create and edit a matrix#

NEW makes a zero matrix, and EDIT opens it in the matrix editor. The top line shows row:column=value. Type a number and press the right-arrow menu key (→) to store it and move on. ENTER does the same as →: it stores the number and moves to the next element (after the last element it wraps to the first). Press EXIT to leave the editor; your edits are kept.

The matrix editor on a new 2 by 2 matrix. Menu keys: insert row, left, up, down, right, delete row. The display shows: 1:1=0.0000 / INS  ←   ↑   ↓   →  DEL.
The matrix editor on a new 2 by 2 matrix. Menu keys: insert row, left, up, down, right, delete row.
Menu keyLabelAction
Σ+INSInsert a row of zeros before the current row.
1/x←Move left (stores the number you were typing).
√x↑Move up.
LOG↓Move down.
LN→Move right.
XEQDELDelete the current row.

The ▲ and ▼ keys also move between rows. Moving past the last cell wraps around to the first.

Example 10.1

Build [[1, 2], [3, 4]]

  1. Type 2, ENTER, 2 and press NEW (first key).

    2ENTER2⇧MATRIX9Σ+
  2. Press EDIT (sixth key). Type each number and press → (fifth key); type the last number and EXIT.

    XEQ1LN2LN3LN4EXIT
    After step 2: Press EDIT (sixth key). Type each number and press → (fifth key); type the last number and EXIT. The display shows: x: [ 2×2 Matrix ] / NEW INV DET TRN SMQ EDT.
Result of the example "Build [[1, 2], [3, 4]]" The display shows: x: [ 2×2 Matrix ] / NEW INV DET TRN SMQ EDT.
You should see[ 2×2 Matrix ]
Example 10.2

Check the editor shows the values

  1. After building the matrix, open EDIT again and move right.

    2ENTER2⇧MATRIX9Σ+XEQ1LN2LN3LN4EXITXEQLN
Result of the example "Check the editor shows the values" The display shows: 1:2=2.0000 / INS  ←   ↑   ↓   →  DEL.
You should see1:2=2.0000

10.3Determinant, inverse and transpose#

det⁡(1234)=1⋅4−2⋅3=−2\det\begin{pmatrix}1&2\\3&4\end{pmatrix}=1\cdot4-2\cdot3=-2
Example 10.3

Determinant of [[1,2],[3,4]]

  1. Build the matrix and press DET (third key).

    2ENTER2⇧MATRIX9Σ+XEQ1LN2LN3LN4EXIT√x
Result of the example "Determinant of [[1,2],[3,4]]" The display shows: x: -2.0000 / NEW INV DET TRN SMQ EDT.
You should see-2.0000
Example 10.4

Inverse: look at the first entry

  1. Build the matrix and press INV (second key).

    2ENTER2⇧MATRIX9Σ+XEQ1LN2LN3LN4EXIT1/x
  2. Open the editor to read it: the first value is −2.

    XEQ
    After step 2: Open the editor to read it: the first value is −2. The display shows: 1:1=-2.0000 / INS  ←   ↑   ↓   →  DEL.
Result of the example "Inverse: look at the first entry" The display shows: 1:1=-2.0000 / INS  ←   ↑   ↓   →  DEL.
You should see1:1=-2.0000
Example 10.5

Transpose

  1. Build the matrix and press TRN (fourth key); the entry at 1:2 is now 3.

    2ENTER2⇧MATRIX9Σ+XEQ1LN2LN3LN4EXITLOGXEQLN
Result of the example "Transpose" The display shows: 1:2=3.0000 / INS  ←   ↑   ↓   →  DEL.
You should see1:2=3.0000

10.4Add, multiply and scale matrices#

The ordinary operations work on matrices: + and − need matrices of the same size, × multiplies a matrix by a number or by a matrix with matching inner size, and ÷ solves a linear system when Y is the right-hand side matrix and X the coefficient matrix.

Example 10.6

Square a matrix

  1. Build [[1,2],[3,4]], duplicate it with ENTER and multiply.

    2ENTER2⇧MATRIX9Σ+XEQ1LN2LN3LN4EXITEXITEXITENTER×⇧MATRIX9XEQ
Result of the example "Square a matrix" The display shows: 1:1=7.0000 / INS  ←   ↑   ↓   →  DEL.
You should see1:1=7.0000
Example 10.7

Multiply by a number

  1. The first entry of 2 times the matrix is 2.

    2ENTER2⇧MATRIX9Σ+XEQ1LN2LN3LN4EXITEXITEXIT2×⇧MATRIX9XEQ
Result of the example "Multiply by a number" The display shows: 1:1=2.0000 / INS  ←   ↑   ↓   →  DEL.
You should see1:1=2.0000

10.5Solve a system of equations#

SIMQ solves Ax=bA\mathbf{x}=\mathbf{b}. Type the number of equations and press SMQ. The menu offers A (coefficients), B (right-hand sides) and X (the answer). Edit A and B, then press X to compute and show the solution.

x+y=3x−y=1⇒x=2,  y=1\begin{aligned}x+y&=3\\x-y&=1\end{aligned}\quad\Rightarrow\quad x=2,\; y=1
Example 10.8

Solve x + y = 3 and x − y = 1

  1. Type 2 and press SIMQ (fifth key). Edit matrix A (first key): 1, 1, 1, −1.

    2⇧MATRIX9LNΣ+1LN1LN1LN1+/−EXIT
    After step 1: Type 2 and press SIMQ (fifth key). Edit matrix A (first key): 1, 1, 1, −1. The display shows: x: 2.0000 /  A   B   X             .
  2. Edit B (second key): 3 and 1.

    1/x3LN1EXIT
  3. Press X (third key). The editor shows x in row 1.

    √x
Result of the example "Solve x + y = 3 and x − y = 1" The display shows: 1:1=2.0000 / INS  ←   ↑   ↓   →  DEL.
You should see1:1=2.0000

10.6Dot product, cross product and unit vectors#

A vector is a matrix with one row or one column. DOT needs two vectors of the same length. CRS needs two vectors of length 3. UVC divides a vector by its length.

Example 10.9

Dot product of (1,0,0) and (0,1,0)

  1. Build both vectors with NEW 1 × 3 and EDIT.

    1ENTER3⇧MATRIX9Σ+XEQ1LN0LN0EXITEXITEXIT1ENTER3⇧MATRIX9Σ+XEQ0LN1LN0EXIT
  2. Open page 2 and press DOT.

    ▼Σ+
Result of the example "Dot product of (1,0,0) and (0,1,0)" The display shows: x: 0.0000 / DOT CRS UVC DIM     EDN.
You should see0.0000
Example 10.10

Unit vector of (3, 4)

  1. Build the vector, open page 2 and press UVC (third key).

    1ENTER2⇧MATRIX9Σ+XEQ3LN4EXIT▼√x
  2. Open the editor: the first value is 0.6.

    ⇧MATRIX9XEQ
Result of the example "Unit vector of (3, 4)" The display shows: 1:1=0.6000 / INS  ←   ↑   ↓   →  DEL.
You should see1:1=0.6000

10.7Name and store matrices#

DIM (page 2, fourth key) makes a named matrix of Y rows and X columns. EDN opens a named matrix for editing. A matrix can also be stored with STO into a register or variable, and recalled with RCL.

Example 10.11

Make a named 2 by 3 matrix

  1. Type 2, ENTER, 3, open page 2 and press DIM. Type M (group J K L M, fourth key) and ENTER.

    2ENTER3⇧MATRIX9▼LOG√xLOGENTER
  2. Recall it.

    EXITRCL⇧ALPHAENTER√xLOGENTER
Result of the example "Make a named 2 by 3 matrix" The display shows: y: 3.0000 / x: [ 2×3 Matrix ].
You should see[ 2×3 Matrix ]
Example 10.12

Store a matrix in a register

  1. Build [[1,2],[3,4]], store it in register 00 and recall it.

    2ENTER2⇧MATRIX9Σ+XEQ1LN2LN3LN4EXITSTO000RCL00
Result of the example "Store a matrix in a register" The display shows: x: [ 2×2 Matrix ] / NEW INV DET TRN SMQ EDT.
You should see[ 2×2 Matrix ]

HP-42S is a trademark of HP Inc.. Trident Calculator is an independent product by South View Studios and is not affiliated with, sponsored by or endorsed by HP. The name is used only to describe the kind of calculator this model resembles; Trident's names, keys, display, fonts and software are its own clean-room design.