![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/276401/image.png)
Graphing a hyperbola with tangent lines
4 次查看(过去 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
0 个评论
回答(1 个)
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/276401/image.png)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!