Re: newbie PolarPlot question
- To: mathgroup at smc.vnet.net
- Subject: [mg25076] Re: newbie PolarPlot question
- From: leko at ix.netcom.com (J. Leko)
- Date: Thu, 7 Sep 2000 22:28:22 -0400 (EDT)
- References: <8ov0jn$9p8@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Doug, You entered: PolarPlot[r, {t, 0, 2 Pi}] when actually, what you meant to say was: PolarPlot[r[t], {t, 0, 2 Pi}]. Also, your function definition should read: r[t_] := 16/(5 + 3 Cos[t]) Note the underscore in the brackets on the left hand side! This is important (see below). I know that's a subtle difference, but what you are asking Mathematica to do is to create a polar plot of the function r(t). It would be the same difference as if in calculus you wrote "f" instead of "f(t)." One is a variable, and the other is a function. In this case, Mathematica sees "r" as an assignment to a symbol which remains static (i.e., constant) throughout the Kernel's lifetime. "r[t_]" on the other hand, says that we have a function of t (the underscore means pattern, or "replace any occurrance of t on the right hand side with the value specified when the function is called), and that the value of this function can change depending on what the value of t is when it is called. I can't help you with your editing. I'm new to this newsgroup myself. J. Leko University of Alabama in Huntsville Please reply to: leko*j at cspar.uah.edu and remove the *. In article <8ov0jn$9p8 at smc.vnet.net>, Doug Magnoli <dmagnoli at home.com> wrote: > I've defined: > > r[t] := 16/(5 + 3 Cos[t]) > > Then I load Graphics, with: > > <<Graphics` > > and ask for: > > PolarPlot[r, {t, 0, 2 Pi}], which tells me: > > ParametricPlot::pptr: > {r Cos[t], r Sin[t]} does not evaluate to a pair > of real numbers at t = 2.617993877991494`*^-7 > > ParametricPlot::pptr: > {r Cos[t], r Sin[t]} does not evaluate to a pair > of real numbers at t = 0.25488992540742256`. > > ParametricPlot::pptr: > {r Cos[t], r Sin[t]} does not evaluate to a pair > of real numbers at t = 0.5328694051959509`. > > General::stop: > Further output of ParametricPlot ::pptr will be > suppressed during this calculation. > > Near as I can make out, x and y should both evaluate to real numbers for > any value of theta between 0 and 2 Pi, so I don't know what I'm doing > wrong. > > ....and, BTW, how do you get all those quotes from mathematica pages into > this newsgroup without having to edit? I tried to copy, e.g., > > In[32]:= PolarPlot[4, {t, 0, 2 Pi}] > > and I don't get the In[32]:= part. Also, when copying those error > messages, I had to edit extensively, or else they look like this when > copied / pasted: > > ParametricPlot::"pptr": "\!\({\(\(r\\ \(\(Cos[t]\)\)\)\), \(\(r\\ \ > \(\(Sin[t]\)\)\)\)}\) does not evaluate to a pair of real numbers at > \!\(t\) \ > = \!\(2.617993877991494`*^-7\)." > > tia, > > -Doug Magnoli