prime:polrec

This shows you the differences between two versions of the page.

Both sides previous revision Previous revision Next revision | Previous revision | ||

prime:polrec [2017/10/16 20:39] webmasterpdx |
prime:polrec [2017/12/15 03:40] (current) webmasterpdx |
||
---|---|---|---|

Line 1: | Line 1: | ||

+ | ====== Polar/Rectangular ====== | ||

+ | Polar coordinates are entered using R∠Angle, where ∠ is Shift-x (multiply). | ||

+ | Rectangular coordinates are entered using complex values as in a+b*i (where i is Shift-2). Also useful is the π symbol (shift-3). | ||

+ | |||

+ | You can convert angles between radians and degrees by using the Shift-Units menus. From the tools menu, the CONVERT function does the conversion. Then you can select (rad) or (deg) from the Units-Angle menu. So, use CONVERT(1.5_(rad),1_(deg)) to convert 1.5 radians to degrees. You do have to enter the 1 in 1_(deg). Note that other angle formats are also available in Units-Angle. | ||

+ | |||

+ | In the geometry app you can enter a point in either form using the point() function. | ||

+ | |||

+ | If you enter a polar coordinate as in 1∠(π/4), and hit enter, and then hit the ∠ button again, it'll convert the number to it's rectangular/complex form. | ||

+ | |||

+ | When using negative angles, be sure to use the +/- key rather than the - key. | ||

+ | |||

+ | Note that if your system is set to radians by default, you can enter degrees by using shift-units and from the units menu, select angle-deg and the value will appear as 30_deg for example. | ||

+ | if you type 1∠30_deg and hit enter, it'll convert automatically to 1∠0.5325... (radians). | ||

+ | To enter a point this way in the geometry app, you cannot enter point(1∠30_deg), but you can enter 1∠30 on the home view and hit enter to convert to radians. Then, in the geometry app, you can enter point() and select menu-copy_from_home and select the radian version to put it in the point call. You can alternatively enter point(EXPR("1∠30_deg")). | ||

+ | |||

+ | The following function is a useful one to have in your arsenal. It will convert from polar to rectangular and vice versa...automatically. It must be run from Home mode. | ||

+ | |||

+ | |||

+ | <code> | ||

+ | EXPORT POLREC(Z) // POLAR/RECT CONVERT | ||

+ | BEGIN | ||

+ | LOCAL T,A,B; | ||

+ | T:=STRING(Z); | ||

+ | IF INSTRING(T,"∠") THEN | ||

+ | // POLAR | ||

+ | A:=RE(Z); | ||

+ | B:=IM(Z); | ||

+ | RETURN EXPR(A "+" B*i); | ||

+ | ELSE | ||

+ | // RECTANGULAR | ||

+ | A:=ABS(Z); | ||

+ | B:=ARG(Z); | ||

+ | RETURN EXPR(A "∠" B); | ||

+ | END // IF... | ||

+ | END // BEGIN | ||

+ | </code> | ||