Hello,

I need to graph this circle in parabola(below) with mathematica?How can i do? Thanks.(parabola is y=x^2)

Printable View

- Nov 10th 2008, 03:00 PMschadenfreudeBeginner to mathematica
Hello,

I need to graph this circle in parabola(below) with mathematica?How can i do? Thanks.(parabola is y=x^2) - Nov 11th 2008, 03:17 AMmr fantastic
This post is a subset of the later post found here: http://www.mathhelpforum.com/math-he...-parabola.html

- Nov 11th 2008, 11:01 AMschadenfreude
- Nov 11th 2008, 11:28 AMshawsend
There are several ways. Here's one using ContourPlot and the formula given in the citation abovel:

Code:`ContourPlot[{y == x^2, x^2 + (y - 1/2)^2 ==`

1/4}, {x, -3, 3}, {y, -3, 3},

Axes -> True]

Code:`f1[x_] := 1/2 + Sqrt[1/4 - x^2];`

f2[x_] := 1/2 - Sqrt[1/4 - x^2];

f3[x_] := x^2;

p1 = Plot[{f1[x], f2[x]}, {x, -2^(-1), 1/2},

PlotRange -> {{-3, 3}, {-3, 3}},

AspectRatio -> 1]

p2 = Plot[f3[x], {x, -2, 2}];

Show[{p1, p2}]

- Nov 11th 2008, 11:51 AMschadenfreude
Thank you very much shawsend.(Bow)(Hi)

- Nov 11th 2008, 03:35 PMshawsend
Third and fourth way just for fun:

Code:`p1 = ParametricPlot[{t, t^2}, {t, -2, 2}]`

p2 = ParametricPlot[{(1/2)*Cos[t],

1/2 + (1/2)*Sin[t]}, {t, 0, 2*Pi}]

Show[{p1, p2}]

Show[{Plot[x^2, {x, -2, 2}],

Graphics[Circle[{0, 1/2}, 1/2]]},

AspectRatio -> 1]

- Nov 12th 2008, 09:51 AMschadenfreude
shawsend,

Thank you very much again but the third way gives an error during calculating. - Nov 12th 2008, 11:09 AMshawsend
Hi. I don't get an error. Maybe it's the version. I have ver 6. Also, sometimes an error occurs when variables have already been assigned numeric quantities. Either clear these variable names via Clear[x,y,z] or just restart Mathematica to see if the error is eliminated.

- Nov 13th 2008, 02:39 PMHood
Yeah, I remember show was super-funky in Mathematica 5 and earlier. Its so much better now, although the order of arguments makes a big difference in the results.

The best way to do this kind of thing is always with contour plot.

By the way, only in the last method do you need to use show. Show is still best avoided if possible, as it doesnt work perfectly (though undeniably much, much better than it used to)

The circle may be undefined outside of [-1/2,1/2], but plot throws no error:

Plot[{1/2 + Sqrt[1/4 - x^2],1/2-Sqrt[1/4 - x^2],x^2},{x,-3,3}]

Replacing t with Pi t maps [-2,2] into [-2 Pi, 2 Pi], which is redundant but works:

ParametricPlot[{{t, t^2}, {1/2 Cos[Pi t],1/2+1/2Sin[Pi t]}}, {t, -2, 2}]

I always prefer not to leave so many variables behind in an operation, unless some of the steps take so much time that it is necessary.