Saturday, May 28, 2022

Casio fx-4000P: Orthonormal 2D Vector Test

Casio fx-4000P:  Orthonormal 2D Vector Test


Introduction


A set of vectors form an orthonormal basis if the vectors are mutually perpendicular and are of unit length.  


Mutual perpendicular means the dot product of two different vectors in the space is 0:


v_i ∙ v_j = 0,  i ≠ j


Unit length means that the norm of each vector is 1:


|v_i| = 1



 For two 2D vectors [ A, B ] and [ C, D ], the two vectors form an orthonormal basis if:


A^2 + B^2 = 1

C^2 + D^2 = 1

A * D + B * C = 0


Casio fx-4000P Program:  Orthonormal 2D Vector Test

Bytes:  84 steps

(line returns are included for readability)


"A":

?→A:

"B":

?→B:

"C":

?→C:

"D":

?→D:

A²+B²≠1⇒Goto 0:

C²+D²≠1⇒Goto 0:

AD+BC≠0⇒Goto 0:

"YES" ⊿

Goto 1:

Lbl 0:

"NO" ⊿

Lbl 1


Examples


Example 1:

[1, 0], [0, 1]

A = 1, B = 0, C = 0, D = 1


"NO"   (1*1 - 0*0 = 1)


Example 2:

[1/√2, 1/√2], [1/√2, -1/√2]

A = 1/√2, B = 1/√2, C = 1/√2, D = -1/√2


"YES"


Source:


Rowland, Todd. "Orthonormal Basis." From MathWorld--A Wolfram Web Resource, created by Eric W. Weisstein. https://mathworld.wolfram.com/OrthonormalBasis.html

Last Accessed April 7, 2022


Eddie 


All original content copyright, © 2011-2022.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Casio fx-CG50 and Swiss Micros DM32: HP 16C’s Bit Summation

  Casio fx-CG50 and Swiss Micros DM32: HP 16C’s Bit Summation The HP 16C’s #B Function The #B function is the HP 16C’s number of...