Represents a function on the N-sphere with axial symmetry.
More...
#include <geomc/function/SphericalHarmonics.h>
template<typename T, index_t Bands>
class geom::ZonalHarmonics< T, Bands >
Represents a function on the N-sphere with axial symmetry.
Useful as a convolution kernel for a SphericalHarmonics or another ZonalHarmonics function.
ZonalHarmonics require O(n) storage space on the number of bands and are generally much more efficient than SphericalHarmonics.
◆ ZonalHarmonics() [1/3]
Construct a new ZonalHarmonics.
If dynamically sized, only a single DC band will be allocated.
◆ ZonalHarmonics() [2/3]
Construct a new ZonalHarmonics (dynamic size).
- Parameters
-
n | Number of bands to allocate. Ignored if the number of bands is not dynamic. |
◆ ZonalHarmonics() [3/3]
◆ bands()
- Returns
- The number of bands in the representation.
◆ clear()
Set all coefficients to zero.
◆ coeff() [1/2]
- Returns
- The
n
th band coefficient.
◆ coeff() [2/2]
T coeff |
( |
index_t |
n | ) |
const |
|
inline |
- Returns
- The
n
th band coefficient.
◆ convolve()
Blur this ZonalHarmonics function using kernel
as a point spread funciton.
- Parameters
-
kernel | Point spread function. |
◆ diffuse()
Convert this ZonalHarmonics function to its form after t
self-convolutions.
If t
is 0, this function becomes an N-band approximation of the dirac (identity) kernel. If t
is 1, this function remains unchanged.
- Parameters
-
t | Real number of times to self-convolve. |
◆ dot()
◆ eval()
T eval |
( |
T |
cos_alt | ) |
const |
|
inline |
Evaluate this ZonalHarmonics function at the given angle.
- Parameters
-
- Returns
◆ generate_lambertian()
void generate_lambertian |
( |
index_t |
order = -1 | ) |
|
|
inline |
Replace this ZonalHarmonics function with an n-th order approximation of the Lambertian diffuse reflectance function (i.e. max(0, cos(alt))
).
- Parameters
-
order | Number of bands to use in the approximation. If no count is specified, all available bands will be used. Note that very high-order approximations may be vulernable to numerical instability. |
◆ generate_spot()
void generate_spot |
( |
T |
cos_angle | ) |
|
|
inline |
Replace this ZonalHarmonics function with an n-th order approximation of a circular spot on the sphere having value 1 and the given angular radius.
- Parameters
-
cos_angle | Cosine of the radial angle of the spot (between -1 and 1). |
◆ get() [1/2]
Return a pointer to the array of coefficients.
◆ get() [2/2]
Return a pointer to the array of coefficients.
◆ normalize()
Ensure the integral over the entire sphere is 1. If the integral is currently 0, no change will be made.
◆ project()
void project |
( |
T |
cos_alt, |
|
|
T |
val |
|
) |
| |
|
inline |
Project the sample having value val
at angle given by cos_alt
to this ZonalHarmonics function.
- Parameters
-
cos_alt | Cosine of the angle from the polar axis to the sample. |
val | Value of the sample. |
The documentation for this class was generated from the following files: