Forum de mathématiques - Bibm@th.net
Vous n'êtes pas identifié(e).
- Contributions : Récentes | Sans réponse
Pages : 1
#1 18-12-2021 20:02:16
- omar452
- Invité
tangente d'une courbe en python
bonjour,
je ne comprends pas pourquoi mon programme python ne construit pas la bonne tangente pour une equation paramétrique.
Pouvez vous m'aider?
return(a*np.sin(b*x**2-c))
def cos2(x,b):
return (a*np.cos(b*x**2-c))
T = [x/10 for x in range(100)]
def integrale (f,b,t):
def evaluation (x):
return(f(x,b))
return(quad(evaluation,0,t)[0])
def sin2(x,b):
return(a*np.sin(b*x**2-c))
def cos2(x,b):
return (a*np.cos(b*x**2-c))
def cons_1tentacule (X1,Y1,b):
#ordonnee à l'origine; + abs(b) est grand plus la tenta est courbée
#b>0 -> tentacule vers le bas
#c = angle d'inclinaison de départ
Xtenta = [X1+integrale(sin2,b,t) for t in T]
Ytenta = [Y1+integrale(cos2,b,t) for t in T]
plt.plot( Ytenta, Xtenta)
return(Xtenta,Ytenta)
X,Y = cons_1tentacule (0,0,0.005)
X1 = [x for x in range (1000)]
tang = [-np.tan(T[a]**2)*(x-X[a])+Y[a] for x in X1]
plt.plot(X1,tang)
Pages : 1







