It's supposed to be like this
UPDATE:
I would like to show the "Blue" curve instead of the "Red" Curve. Even though I changed the equation in wolfram, the place of the curve did not move.
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityClear["Global`*"]
In ParametricPlot
you just interchange the coordinates. Both shown for comparison.
ParametricPlot[
{{t, Sqrt[10 + t^2]}, {Sqrt[10 + t^2], t}},
{t, -20, 30},
PlotStyle -> {Red, Blue},
PlotLegends -> Placed[
{HoldForm[y == Sqrt[10 + x^2]],
HoldForm[x == Sqrt[10 + y^2]]},
{.6, .9}]]
Export[
"Test.GIF",
With[
{
f=Function[{x}, Sqrt[10+x^2]]
},
Animate[
ParametricPlot[
RotationTransform[angle][{f[x],x}]
, {x, -10,10}
, AspectRatio -> 1
, PlotRange -> {{-10,10}, {-10,10}}
]
, {angle, 0, 2Pi, Pi/16}
]
]
]
Using ReflectionTransform
:
Clear[f, g, x, y]
f[x_] := Sqrt[x^2 + 10]
g[x_] := Sqrt[x^2 + 50]
p1 = Plot[{f[x], g[x]}, {x, -10, 10}];
Show[p1, Plot[x, {x, -15, 15}, PlotStyle -> {Dashed, Black}],
p1 /. L_Line :> {GeometricTransformation[L,
ReflectionTransform[{-1, 1}]]},
PlotRange -> {{-15, 15}, {-15, 15}}
, AspectRatio -> Automatic
, AxesOrigin -> {0, 0}
]
Using ContourPlot
:
ContourPlot[
{y == f[x], x == f[y]} // Evaluate
, {x, -15, 15}, {y, -15, 15}
, Axes -> True
, AxesStyle -> Dashed
]
To get both curves:
ContourPlot[
{{y == f[x], y == g[x]}, {x == f[y], x == g[y]}} // Evaluate
, {x, -15, 15}, {y, -15, 15}
, ContourStyle -> {ColorData[97][1], ColorData[97][2]}
, Axes -> True
, AxesStyle -> Dashed
]
ReflectionTransform
doc page and then this question popped up.
$\endgroup$
Show
command, don't include p1
. The Show
command is showing three entities; the original plot, the dashed lines and the transformed plot. Use as required.
$\endgroup$
Show[p1 /. L_Line :> {GeometricTransformation[L, ReflectionTransform[{-1, 1}]]}, PlotRange -> {{-15, 15}, {-15, 15}}, AspectRatio -> Automatic, AxesOrigin -> {0, 0}]
$\endgroup$
Rotate[Plot[…], 90°]
$\endgroup$ParametricPlot[{Sin[x],x},{x,0,10}]
? $\endgroup$