-2
$\begingroup$

How can I rotate this curveenter image description here

It's supposed to be like this

enter image description here

UPDATE:

enter image description here

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.

$\endgroup$
6
  • 1
    $\begingroup$ If you really want to rotate everything, you can do Rotate[Plot[…], 90°] $\endgroup$
    – Lukas Lang
    Feb 1 at 14:15
  • $\begingroup$ I'm sorry, I just want to rotate the curve $\endgroup$
    – Sneaks
    Feb 1 at 14:21
  • 1
    $\begingroup$ Then something like ParametricPlot[{Sin[x],x},{x,0,10}]? $\endgroup$
    – Lukas Lang
    Feb 1 at 14:25
  • 1
    $\begingroup$ People here generally like users to post code as copyable Mathematica code instead of just images or TeX, so they can copy-paste it. It makes it convenient for them and more likely you will get someone to help you. You may find the meta Q&A, How to copy code from Mathematica so it looks good on this site, helpful $\endgroup$
    – Michael E2
    Feb 1 at 14:46
  • $\begingroup$ Welcome to Mathematica S.E. To start: 1) take the introductory tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, since the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) consider accepting the answer, if any, that solves your problem, by clicking checkmark sign, 4) give help too, by answering questions in your areas of expertise. $\endgroup$
    – bmf
    Feb 3 at 3:12

3 Answers 3

4
$\begingroup$
Clear["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}]]

enter image description here

$\endgroup$
3
$\begingroup$
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}
        ]
    ]
]

enter image description here

$\endgroup$
3
$\begingroup$

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}
 ]

enter image description here


Using ContourPlot:

ContourPlot[
 {y == f[x], x == f[y]} // Evaluate
 , {x, -15, 15}, {y, -15, 15}
 , Axes -> True
 , AxesStyle -> Dashed
 ]

enter image description here

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
 ]
$\endgroup$
5
  • 1
    $\begingroup$ By total chance I was on the ReflectionTransform doc page and then this question popped up. $\endgroup$
    – Syed
    Feb 1 at 14:48
  • $\begingroup$ [In your ReflectionTransform plot] Is there a possible way to remove the upper curves and just show the curves on the right-side of the graph? $\endgroup$
    – Sneaks
    Feb 1 at 15:27
  • $\begingroup$ In the 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$
    – Syed
    Feb 1 at 15:31
  • $\begingroup$ Ahh thanks I got it! How about the dashed line? $\endgroup$
    – Sneaks
    Feb 1 at 15:44
  • $\begingroup$ Show[p1 /. L_Line :> {GeometricTransformation[L, ReflectionTransform[{-1, 1}]]}, PlotRange -> {{-15, 15}, {-15, 15}}, AspectRatio -> Automatic, AxesOrigin -> {0, 0}] $\endgroup$
    – Syed
    Feb 1 at 15:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.