Professional Documents
Culture Documents
All All Xyx - Ty - T: Question Plot The Tangent Line For The Equation F X 2+x Y-Y 2-1 at The Point (X, Y) (2,3) Code
All All Xyx - Ty - T: Question Plot The Tangent Line For The Equation F X 2+x Y-Y 2-1 at The Point (X, Y) (2,3) Code
Code ;
clc
clear all
close all
f=x^2+x*y-y^2-1;
x1=2;y1=3;
figure(1)
h1=plot(x1,y1,'*','Markersize',16);
set(h1,'color','r')
hold on
h2=ezplot(f);
set(h2,'color','k')
hold on
dydx=-diff(f,x)/diff(f,y);
m=subs(dydx,[x,y],[2,3]);
y_t=m*(x_t-x1)+y1;
h3=ezplot(y_t);
set(h3,'color','g')
hold off
Output ;
Graph ;