diff --git a/src/sphere/sphere.cpp b/src/sphere/sphere.cpp
index 288c259f4aee6b48efe3b6980af1e87f01e6dbd8..d9a1fd3449ae4fe4153619f63301f2ee5f43384c 100644
--- a/src/sphere/sphere.cpp
+++ b/src/sphere/sphere.cpp
@@ -576,6 +576,12 @@ int sphere_jxi488_cycle(
     oi->vec_vk[jxindex] = vk;
     oi->vec_xi[jxindex] = xi;
   }
+  // Adaptive definition of L_MAX
+  double wavelength = 2.0 * pi / vk;
+  double size_param = 2.0 * pi * sconf->get_radius(0) / wavelength;
+  int N = int(size_param + 4.05 * pow(size_param, 1.0 / 3.0)) + 2;
+  if (N < l_max) l_max = N;
+  // End of adaptive definition of L_MAX
   vtppoanp->append_line(VirtualBinaryLine(vk));
   double thsca = (gconf->isam > 1) ? sa->ths - sa->th : 0.0;
   for (int i132 = 0; i132 < nsph; i132++) {