cancel
Showing results for
Did you mean:
New member
3 2 0 0
Message 1 of 4
1,044
Flag Post

Solved!

# divide a vector by a scalar in RPN

HP Recommended
HP Prime

How do I divide a vector by a scalar to get a unit vector.  I can enter the vector in the stack, and I can copy and determine the magnitude, but when I hit divide, it shows the original vector over the divisor.  If I try to use that vector in a dot product calculation, it does not return a value.

Tags (1)
3 REPLIES 3
New member
3 2 0 0
Message 2 of 4
Flag Post
HP Recommended

Found my answer.  I have to hit the evaluate button.

Level 8
623 610 117 207
Message 3 of 4
Flag Post
HP Recommended

This is a puzzlement, since I just tried doing that on 8 different HP Primes with 8 different versions of the firmware, and they all did what I think you want.

There were my specific keystrokes in RPN mode in Home view:

[ 3, 4 ] ENTER (to put the vector on level 1 of the stack)

ENTER (to copy it to level 2)

ABS (obtained by pressing Shift +/-)

÷ (the divide key)

--> [ 0.6, 0.8 ] (the desired result)

Please tell us your exact key sequence, what the result is, and what you want the result to be.

In case it isn't obvious, RPN mode only works in Home view, not in CAS view.

Side note: You can find the "unit vector" for a complex number by executing the SIGN function.  If the Complex Display mode (in Home Settings) is set to (a,b) instead of a+bi, complex numbers are even displayed as vectors, which is nice.

Disclaimer: I don't work for HP. I'm just another happy HP Prime user.

-Joe-
Tags (1)
New member
3 2 0 0
Message 4 of 4
Flag Post
HP Recommended

Thanks Joe. My two vectors were [112] and [100] I was using the function L2 Norm in the vector menu to get the magnitude of [112] which returns SQRT(6) rather than a numerical value.  If I hit evaluate, it give numerical values, but your way is much better with the shift +/- button.  Thanks!

† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation