Re: General--IF condition in Plot3D
- To: mathgroup at smc.vnet.net
- Subject: [mg69014] Re: General--IF condition in Plot3D
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Sat, 26 Aug 2006 04:40:04 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <ecoojc$2s6$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
madhukarrapaka at yahoo.com wrote: > How to use a IF condition in Plot3D?? > > For example: > I have "I" values caluclated by I=P/2*Pi*r*L .; where P=10.3,L=0.45,r=dist. > So if i want to plot "I" when "r<x", how to do it?? > (Here i am giving my procedure thru which i am getting a Plot with some warning) > r[x_,y_]:=Sqrt[x^2+y^2]; > I[x_,y_]:=P/2*Pi*r[x_,y_]*L > Plot3D[If[r[x,y]<=0.082,I[x,y]],{x,-0.082,0.082},{y,-0.082,0.082}] > [...] > Is there anything wrong in the syntax or range specification. The following works: r[x_, y_] := Sqrt[x^2 + y^2]; i[x_, y_] := (P/2)*Pi*r[x, y]*L Plot3D[Boole[r[x, y] <= 0.082]*i[x, y] /. {P -> 10.3, L -> 0.45}, {x, -0.082, 0.082}, {y, -0.082, 0.082}]; HTH, Jean-Marc