27 - VEKTOR - Vector Operations

Post Reply
Peet
Posts: 257
Joined: Tue Sep 29, 2020 12:01 am
Location: Germany

27 - VEKTOR - Vector Operations

Post by Peet »

Code: Select all

LBL "VEKTOR"
FIX 2
SF 27
SF 28
"C- C+ C* C/"
PROMPT
LBL A		; "CSUB"
CHS
X<>Y
CHS
X<>Y		; 1981 fix
LBL B		; "CADD"
X<>Y
RDN
+
RDN
+
R^
GTO 08		; display UV 
LBL D		; "CDIV"
R-P
1/X
X<>Y
CHS
GTO 10
LBL C		; "CMULT"
R-P
X<>Y
LBL 10
RDN
RDN
R-P
R^
*
RDN
+
R^
P-R
LBL 08
"U="
ARCL X
"|-, V="
ARCL Y
AVIEW
END
HP41 Standard Applications (based on 1981 bug-fixed version, modified).
Changes (among others): local instead of global label, R00->R10

This program does substract, add, multiply or devide two vectors.

Usage:
Arithmetic-Keys: A=C- B=C+ C=C* D=C/

Stack: X:U2 Y:V2 Z:U1 T:V1
The two vectors are denoted by: U1+iV1 and U2+iV2

Example:
Add 1+i2 to 4+i6
input: 6 enter 4 enter 3 enter 1 <B>
Display: U=5.00, V=9.00
Attachments
27_VEKTOR.raw
(85 Bytes) Downloaded 237 times
My programmable calculators - former: CBM PR100, HP41CV, HP28S, HP11C - current: HP48G(256kB), HP35S, Prime, DM41X, DM42
Post Reply