       • To: mathgroup at smc.vnet.net
• From: Peter Breitfeld <phbrf at t-online.de>
• Date: Mon, 8 Nov 2004 03:13:20 -0500 (EST)
• References: <cmfc9b\$7k3\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```motz art schrieb:
> Mathematica v5: How can I input vectors in polar form and
> rectangular form?
>
> Example:
>
> a:= (r1, theta1) + (r2, theta2)  Polar form.
>
> b:= (re1 , j* im1) + (re2, j*im2) Rectangular form
>

You could write two simple functions:

pf[a_,d_]:=N[a E^(I d Degree)]
polar[z_]:={Abs[z*1.],Arg[z*1.]/Degree"\[Degree]"}
(the "*1." are added to force numerical evaluation)

then you enter your values using pf:

In:= sum=pf[10,30]+pf[20,45]
Out= 22.8024+19.1421 I          (rectangular result)
In:= polar[sum]
Out= {29.772, 40.0128°)        (displayed polar form of result)

Mathematica displays complex numbers in rectangular form by default,
so there is no need for a function "rectangular".
Input in rectangular form is input as a complex number:

value=100+100 I
polar[value] ---> {141.421, 45.°)

Gruß Peter
--
==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de

```

• Prev by Date: NonlinearFit problem
• Next by Date: Mathematica Categorization - Humor