aboutsummaryrefslogtreecommitdiff
path: root/src/nd-random.sc
AgeCommit message (Collapse)Author
2021-06-30Support sampling in sphere.Arun Isaac
* src/nd-random.sc (random-vector-in-sphere): New function. * include/nd-random.h (random_vector_in_sphere): Declare it.
2021-03-16Deal in solid angle fractions, not absolute solid angles.Arun Isaac
* src/extent-sampling.sc (volume-cone): Use solid-angle-fraction->planar-angle instead of solid-angle->planar-angle. * src/nd-random.sc (planar-angle->solid-angle): Rename to planar-angle->solid-angle-fraction and return a solid angle fraction. (solid-angle->planar-angle): Rename to solid-angle-fraction->planar-angle and accept a solid angle fraction. (hollow-cone-random-vector): Use planar-angle->solid-angle-fraction instead of planar-angle->solid-angle. (beta-inc-unnormalized, incomplete-wallis-integral): Delete functions. * include/nd-random.h (planar_angle_to_solid_angle): Rename to planar_angle_to_solid_angle_fraction. (solid_angle_to_planar_angle): Rename to solid_angle_fraction_to_planar_angle. * scm/nsmc/wrap.scm (planar-angle->solid-angle): Rename to planar-angle->solid-angle-fraction.
2021-03-16Fix edge case when vectors around the nth canonical axis are required.Arun Isaac
* src/nd-random.sc (rotate-from-nth-canonical): Do nothing when vectors around the nth canonical axis are required.
2021-03-16Implement simplified cone sampling algorithm.Arun Isaac
* src/nd-random.sc (hollow-cone-random-vector): Implement simplified algorithm that directly samples the surface of the sphere instead of sampling a disk and projecting it onto the surface.
2021-02-26Add copyright and license headers for all files.Arun Isaac
* include/extent-sampling.h, include/gaussian-nd-random.h, include/integrands.h, include/nd-random.h, include/oracles.h, include/utils.h, src/extent-sampling.sc, src/gaussian-nd-random.sc, src/integrands.sc, src/macros/macros.sc, src/nd-random.sc, src/oracles.sc, src/utils.sc, CMakeLists.txt, pre-inst-env.in: Add copyright and license headers.
2021-02-26Rename subsampling-random-vector to cone-random-vector.Arun Isaac
* scm/nsmc/wrap.scm: (subsampling-random-vector): Rename to cone-random-vector. * src/nd-random.sc (subsampling-random-vector): Rename to cone-random-vector. * include/nd-random.h (subsampling_random_vector): Rename to cone_random_vector.
2021-02-11Remove unnecessary whitespace.Arun Isaac
* src/nd-random.sc (solid-angle->planar-angle): Remove unnecessary whitespace at the beginning of the line.
2021-02-10Declare planar, solid angle conversion functions as public.Arun Isaac
* src/nd-random.sc (planar-angle->solid-angle, solid-angle->planar-angle): Declare these to be a part of the public interface of the module.
2021-02-05Migrate C source to SC.Arun Isaac
sph-sc is a scheme-like S-expression syntax for C. It elements much of the pain and repetition involved in writing C syntax. * src/extent-sampling.c, src/gaussian-nd-random.c, src/nd-random.c, src/oracles.c, src/utils.c: Delete files. * src/extent-sampling.sc, src/gaussian-nd-random.sc, src/macros/macros.sc, src/nd-random.sc, src/oracles.sc, src/utils.sc: New files. * CMakeLists.txt: Generate C source files from SC source files.