Converting Polar and Rectangular

05052022, 05:05 AM
Post: #1




Converting Polar and Rectangular
I’m having trouble downloading a certain program for my hp prime. Every time I type in the programs below I get a syntax error. Is there anyone that has a link where I can download these programs rather than manually put them in?
P_to_R(r,a):= BEGIN return (r*COS(a)+r*SIN(a)*i); END; R_to_P(x,y):= BEGIN return (CAS(collect(ABS(x+y*i)))+"∡"+CAS(collect(ARG(x+y*i)))); END; 

05052022, 02:30 PM
Post: #2




RE: Converting Polar and Rectangular
Should the programs not start with
EXPORT P_2_R(x,y) Or something instead of your first lines? If you try it on a calculator, it will tell you where the problem is, by clicking Info after running the program, or clicking Check, when in writing the program. 

05052022, 04:07 PM
(This post was last modified: 05052022 04:20 PM by Didier Lachieze.)
Post: #3




RE: Converting Polar and Rectangular
These are CAS programs, you need to add #cas and #end statements:
Code: #cas Btw, you can use instead of these programs the builtin functions rectangular_coordinates() and polar_coordinates() as explained here. 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)