# -*- coding: utf-8 -*- """ Exercice 1-5 : tracé de courbes et recherche de points remarquables Created on Tue Dec 02 15:34:14 2014 @author: grivet """ import numpy as np import matplotlib.pyplot as plt def f(t,a): return t - a*np.sin(t) def g(t,a): return 1 - a*np.cos(t) t = np.linspace(-2.0,2.0,500) plt.subplot(2,1,1) a = 0.5; plt.plot(t,f(t,a),"r-") plt.plot(t,g(t,a),"r-") a = 1.0 plt.plot(t,f(t,a),"g-") plt.plot(t,g(t,a),"g-") a = 1.5 plt.plot(t,f(t,a),"b-") plt.plot(t,g(t,a),"b-") plt.subplot(2,1,2) a = 0.5 plt.plot(f(t,a),g(t,a),"r-") a = 1.0 plt.plot(f(t,a),g(t,a),"g-") a = 1.5 plt.plot(f(t,a),g(t,a),"b-") y = g(t,a) x = f(t,a) iy = abs(y) < 0.01 print ('x: ', x[iy]) ix = abs(x) < 0.005 print ('y: ', y[ix]) print ('t: ', t[ix]) plt.show()