cancel
Showing results for 
Search instead for 
Did you mean: 
Magnus512
Level 3
55 34 0 2
Message 1 of 4
1,108
Flag Post

Solved!

Unit Vector

HP Recommended
HP Prime
Other

There's any function to get the unit vector from a vector with 3 elements? 
By example

[2 4 5]

I know how define a function to do that, but there's something by default?

0 Kudos
3 REPLIES 3
cyrille
Level 6
Level 6
252 251 42 77
Message 2 of 4
Flag Post
HP Recommended

Hello,

 

There is no funciton that I know of, but you can use the following key sequence to make it easy:

[2, 3, 4] ENTER (places the vector on the stack and in Ans)

Ans/ABS(Ans) ENTER (returns the unit vector).

 

Cyrille

I am an HP Employee
0 Kudos
Magnus512
Author
Level 3
55 34 0 2
Message 3 of 4
Flag Post
HP Recommended
I made a program, but now I want to know if there's a way to implement the program in RPN mode.
0 Kudos
Tim_Wessman
Level 8
Level 8
747 744 121 187
Message 4 of 4
Flag Post
HP Recommended

Your program you wrote will execute just fine in RPN as well. There is no "RPN" programming mode.

 

Note that when the program is returned from the Toolbox->User->[progname>]->[progfunc] location it returns to the command line as PROGNAME(). You can immediately press enter and it executes taking the ars from the stack. Only in the case of a function that accepts differening numbers of arguments would you put anything inside the () to tell the system how many args to take from the stack.

TW

Although I work for the HP calculator group as a head developer of the HP Prime, the views and opinions I post here are my own.
0 Kudos
† 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