Skip to Content

traitement

  1. >>> import math
  2. >>> from shapely.geometry import LineString
  3. >>> list_x = [ 2.*math.pi/5000*i for i in range(5001) ]
  4. >>> courbe_sinus = [ (list_x[i],math.sin(list_x[i])) for i in range(5001) ]
  5. >>> courbe_cosinus = [ (list_x[i],math.cos(list_x[i])) for i in range(5001) ]
  6. >>> sinus = LineString(courbe_sinus)
  7. >>> cosinus = LineString(courbe_cosinus)
  8. >>> intersections = sinus.intersection(cosinus)
  9. >>> intersections.geom_type
  10. 'MultiPoint'
  11. >>> intersections.wkt
  12. 'MULTIPOINT (0.7853981633974484 0.7071067811865475, 3.9269908169872414 -0.7071067811865476)'