Group Abstract Group Abstract

Message Boards Message Boards

Need help getting Plot to work on the standard equation for a circle

GROUPS:
f[x_, y_] := x^2 + y^2 == 25

Plot[f[x, y], {x, -20, 20}, {y, -20, 20}, AxesLabel -> {x, y}]

Plot::nonopt: Options expected (instead of {y,-20,20}) beyond position 2 in Plot[f[x,y],{x,-20,20},{y,-20,20},AxesLabel->{x,y}]. An option must be a rule or a list of rules. >>

Ideally, after getting Plot to work, I would like to hand the same function to RevolutionPlot3D to generate a sphere.

Thanks.
POSTED BY: Siamak Shahbazi
Answer
1 year ago
You need to use ContourPlot to plot curves given in implicit form.
i.e.
ContourPlot[x^2 + y^2 == 25, {x, -20, 20}, {y, -20, 20}, Axes -> True,
  AxesLabel -> {x, y}]
POSTED BY: Luca M
Answer
1 year ago
Plot would work if you solve for y to make the function depend on just x.
Note that Plot wants single-valued functions, so to get the top and bottom halves the two solutions are both given.

Plot[{Sqrt[25 - x^2], -Sqrt[25 - x^2]}, {x, -20, 20},
AxesLabel -> {x, y},
AspectRatio -> Automatic]
POSTED BY: Bruce Miller
Answer
1 year ago