Post Reply 
Converting Polar and Rectangular
05-05-2022, 04:07 PM (This post was last modified: 05-05-2022 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
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; 
#end

Btw, you can use instead of these programs the built-in functions rectangular_coordinates() and polar_coordinates() as explained here.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Converting Polar and Rectangular - Didier Lachieze - 05-05-2022 04:07 PM



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