1 |
+ |
#ifndef lint |
2 |
+ |
static const char RCSid[] = "$Id$"; |
3 |
+ |
#endif |
4 |
|
/* |
5 |
< |
=============================================================== |
5 |
> |
================================================================== |
6 |
|
Dump photon maps as RADIANCE scene description to stdout |
7 |
|
|
8 |
|
Roland Schregle (roland.schregle@{hslu.ch, gmail.com}) |
9 |
|
(c) Fraunhofer Institute for Solar Energy Systems, |
10 |
< |
Lucerne University of Applied Sciences & Arts |
10 |
> |
(c) Lucerne University of Applied Sciences and Arts, |
11 |
> |
supported by the Swiss National Science Foundation (SNSF, #147053) |
12 |
|
================================================================== |
13 |
|
|
14 |
|
$Id$ |
22 |
|
#include "rtio.h" |
23 |
|
#include "resolu.h" |
24 |
|
#include "random.h" |
25 |
+ |
#include "math.h" |
26 |
|
|
27 |
|
|
28 |
|
/* Defaults */ |
171 |
|
(= sphere distrib density ^-1/3) */ |
172 |
|
vol = (maxPos [0] - minPos [0]) * (maxPos [1] - minPos [1]) * |
173 |
|
(maxPos [2] - minPos [2]); |
174 |
< |
rad = radScale * RADCOEFF * cbrt(vol / numSpheres); |
174 |
> |
rad = radScale * RADCOEFF * pow(vol / numSpheres, 1./3.); |
175 |
|
|
176 |
|
/* Photon dump probability to satisfy target sphere count */ |
177 |
|
dumpRatio = numSpheres < numPhotons ? (float)numSpheres / numPhotons |