Bonjour ! J'ai un problème pour un DM en Spé (1ère) : sur la tangente d'une courbe sur PYTHON ->
Le programme est là :

import matplotlib.pyplot as plt
import numpy as np
from math import sqrt

def f(x):
return(sqrt(x))

def derivee_f(x):
return(1/(2*sqrt(x)))

def trace_racine_carre(xmin,xmax):
LX=np.linspace(xmin,xmax,100)
LY=np.sqrt(LX)
plt.plot(LX,LY,"r-")

def trace_tangente(f,a):
LX=np.linspace(-10,10,100)
LY=((derivee_f(a))*(LX-a)+f(a))
plt.plot(LX,LY,"b-")

plt.axis([-5,10,0,15])
plt.grid()
trace_racine_carre(0,10)
trace_tangente(f,3)
plt.show()
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Lista de comentários


Helpful Social

Copyright © 2024 ELIBRARY.TIPS - All rights reserved.