plotting - Eliminating the Parameter: Transform parametric equation to Cartesian equation and draw arrows along parametric growth
Hey guys I really could use some help on this calc 3 problem. I'm stuck on how to write the code for this problem:
- a) Eliminate the parameter to find a Cartesian equation for a parametric curve.
- b) Sketch the curve and indicate with an arrow the direction in which the curve is traced as the parameter increases.
Given: $x=1-t^2$, $y=t-2$
{x == 1 - t^2, y == t - 2}
I'm not sure really where to start. Thanks for the help!
Answer
Start by using Eliminate
to remove the parametric variable
Eliminate[{x == 1 - t^2, y == t - 2}, t]
-3 - 4 y - y^2 == x
Now you can Solve
to get an expression of the form $y(x) = -2 \mp \sqrt{1 - x}$
sol = (y /. Solve[-3 - 4 y - y^2 == x, y])
{-2 - Sqrt[1 - x], -2 + Sqrt[1 - x]}
To sketch you will need to know where it crosses the axis
sol /. x -> 0
{-3, -1}
That is, it crosses at {{0, -3}, {0, -1}, {-3, 0}}
. With which slopes?
D[sol, x]
{1/(2 Sqrt[1 - x]), -(1/(2 Sqrt[1 - x]))}
Slopes are {1/2, -1/2, -1/4}
respectively.
Now the plot with arrows growing in the same direction as $\hat{y}$, i.e up, to the right for $t < -1$ and to the left for $t > 1$
Plot[
sol,
{x, -9, 2},
PlotStyle -> Black
, Frame -> True
, Prolog -> {Blue,
Arrow[Partition[
Transpose[{1 - t^2, t - 2} /. t -> Range[-5, 5, 0.5]], 2, 1]]}
, Epilog -> {PointSize[Large], Red,
Point[{{0, -3}, {0, -1}, {-3, 0}}]}
]
Comments
Post a Comment