star-schiff

Library for estimating radiative properties
git clone git://git.meso-star.com/star-schiff.git
Log | Files | Refs | README | LICENSE

sschiff_scattering_angles_distributions.c (1427B)


      1 /* Copyright (C) 2015, 2016, 2026 Centre National de la Recherche Scientifique
      2  * Copyright (C) 2026 Clermont Auvergne INP
      3  * Copyright (C) 2026 Institut Mines Télécom Albi-Carmaux
      4  * Copyright (C) 2020, 2021, 2023, 2026 |Méso|Star> (contact@meso-star.com)
      5  * Copyright (C) 2026 Université de Lorraine
      6  * Copyright (C) 2026 Université de Toulouse
      7  *
      8  * This program is free software: you can redistribute it and/or modify
      9  * it under the terms of the GNU General Public License as published by
     10  * the Free Software Foundation, either version 3 of the License, or
     11  * (at your option) any later version.
     12  *
     13  * This program is distributed in the hope that it will be useful,
     14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     16  * GNU General Public License for more details.
     17  *
     18  * You should have received a copy of the GNU General Public License
     19  * along with this program. If not, see <http://www.gnu.org/licenses/>. */
     20 
     21 #include "sschiff.h"
     22 #include <rsys/math.h>
     23 
     24 static void
     25 uniform(double* angles, const size_t nangles)
     26 {
     27   size_t iangle;
     28   const double step = PI / (double)(nangles - 1);
     29   ASSERT(nangles >= 2);
     30 
     31   angles[0] = 0.0;
     32   FOR_EACH(iangle, 1, nangles-1) {
     33     angles[iangle] = angles[iangle-1] + step;
     34   }
     35   angles[nangles-1] = PI;
     36 }
     37 
     38 const sschiff_scattering_angles_distribution_T 
     39 sschiff_uniform_scattering_angles = uniform;
     40