Graphing a hyperbola with tangent lines

10 次查看(过去 30 天)
Hello,
I keep attempting to graph a function of a hyperbola, which is coming out okay.
The issue I am having is that I want to inclue two tangent lines on this hyperbola. I have the x values of each of the tangent lines, but I do not know how to make matlab find the y values for the given x, and then plot them.
Here is my function :
syms x y;
F(x,y) = 2*y-3*x-3*x*y+x^2+y^2-6;
Also I am using fimplicit to plot this hyperbola initially. Is this correct? Can anyone offer insight on how to graph these tangent lines? Ive attempted so many methods in the last 2 days and they all come close, but the tangent lines arent exactly "Tangent looking" For example one or the other lies directly on the curve.
My given x value is 8.9

回答(1 个)

darova
darova 2020-3-10
I just exstracted data from ezplot handle
syms x y
F = 2*y-3*x-3*x*y+x^2+y^2-6;
h = ezplot(F,[-1 1]*10);
x1 = get(h(1),'xdata');
x2 = get(h(2),'xdata');
y1 = get(h(1),'ydata');
y2 = get(h(2),'ydata');
hold on
plot([x1(1) x2(1)],[y1(1) y2(1)])
plot([x1(end) x2(end)],[y1(end) y2(end)])
hold off
achievement

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by