Message Boards Message Boards

0
|
2497 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Put a 2D line equation on a contour plot?

Posted 4 years ago

Right now I have the contour plot equation:

ContourPlot[ E^(-((x^2) + (2 y^2))/10^4), {x, -100, 100}, {y, -100, 100}, 
 Epilog -> {PointSize[0.018], Point[{{50, -40}, {0, 0}}]}, 
 PlotStyle -> Brown]

And I have the line equation of the parabola y = -.016*x^2 that I'm wanting to graph onto the contour plot between the two points (50,-40) and (0,0). How do I draw this line equation onto the contour plot?

2 Replies

Yes, that is exactly what I was looking for! Thank you for your help!

Posted 4 years ago

Hi Nathaniel,

Is this what you are looking for?

cp = ContourPlot[
  E^(-((x^2) + (2 y^2))/10^4), {x, -100, 100}, {y, -100, 100}, 
  Epilog -> {PointSize[0.018], Point[{{50, -40}, {0, 0}}]}];

y[x_] = -.016*x^2

Show[{cp, Plot[y[x], {x, 0, 50}, PlotStyle -> Red]}]

enter image description here

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract