Question: Calculus 3 : How can I convert coordinates from rectangular to cylindrical?

 rtoc(x,y,z):= < sqrt(x^(2)+y^(2)) | if 0<x then (arctan(y/(x)))else (Pi+arctan((y)/(x)) )end if  ; | z     >

I am a new user migrating my calculus labs from Derive to Maple.

One exercise asks the student to "write a program" to convert coordinates of a point between 3-D coordinate systems. 

I have tried the function definition given above and the error message is "unable to math delimiters.  I have checked and rechecked and fiddled with more and less parentheses to no avail.  The problem seems to be in the if statement because the following works OK.

rtoc1(x,y,z):= < sqrt(x^(2)+y^(2)) | arctan((y)/(x))  |z     >
Please Wait...