Try Insert > Program Editor > New
Name it, say rec2pol.
Choose Function (rather than Program)
Define Function rec2pol(x, y)
Func
Local rad, ang (A function can only have local variables, so it leaves no trace)
rad := norm([x,y]) (Norm takes as its argument a vector or matrix, hence the square brackets)
ang := arctan(y/x) (Note the use of ":=" to define variables)
return {rad, ang} (A function must return a single argument, so here put both values in a list)
endFunc
--
With best wishes,
Steve
_________________
Dr Stephen Arnold
Educational Technology Consultant
Compass Learning Technologies
T3 Fellow, Teachers Teaching with Technology Australia
Office:
+61-2-4232-2080Mobile: +61-4-0175-3834
Web:
http://compasstech.com.au_________________