aboutsummaryrefslogtreecommitdiff
path: root/src/extent-sampling.sc
diff options
context:
space:
mode:
authorArun Isaac2021-03-16 15:01:45 +0530
committerArun Isaac2021-03-16 15:16:37 +0530
commit30104d8ee20733cf4e2195ef9a6cd202a7a257e5 (patch)
treed79c075e5091992a2c57d54d64f84d19b339e3c0 /src/extent-sampling.sc
parentb90b54cd3f8d9242ff6d1189e65eaff7212fe44e (diff)
downloadnsmc-30104d8ee20733cf4e2195ef9a6cd202a7a257e5.tar.gz
nsmc-30104d8ee20733cf4e2195ef9a6cd202a7a257e5.tar.lz
nsmc-30104d8ee20733cf4e2195ef9a6cd202a7a257e5.zip
Deal in solid angle fractions, not absolute solid angles.
* 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.
Diffstat (limited to 'src/extent-sampling.sc')
-rw-r--r--src/extent-sampling.sc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/extent-sampling.sc b/src/extent-sampling.sc
index 48e6544..73f0e3d 100644
--- a/src/extent-sampling.sc
+++ b/src/extent-sampling.sc
@@ -142,8 +142,8 @@
(declare volume double)
(let* ((dimension (unsigned int) (: mean size))
(vn double (ln-volume-of-ball dimension))
- (theta-min double (solid-angle->planar-angle (* omega-min (surface-area-of-ball dimension)) dimension))
- (theta-max double (solid-angle->planar-angle (* omega-max (surface-area-of-ball dimension)) dimension)))
+ (theta-min double (solid-angle-fraction->planar-angle omega-min dimension))
+ (theta-max double (solid-angle-fraction->planar-angle omega-max dimension)))
(with-rstats stats
(with-vector x dimension
(for-i i number-of-samples