2장(3)-이현아

1200 days 전, gusdk5531 작성

var('x,y') f(x,y)=x^2+2*x*y-y^2+x fx=diff(f(x,y),x) fy=diff(f(x,y),y) m(x,y)=-fx/fy x0=1 y0=2 p1=implicit_plot(f(x,y)==2,(x,-4,4),(y,-4,4)) p2=implicit_plot(y-y0==m(x0,y0)*(x-x0),(x,-4,4),(y,-4,4),color='red') show(p1+p2) 
       
g(x)=m(x0,y0)*(x-x0)+y0 print g(x) 
       
7/2*x - 3/2
7/2*x - 3/2