MCPcopy Create free account
hub / github.com/MarcCoru/locationencoder / SH

Function SH

locationencoder/pe/spherical_harmonics_closed_form.py:32–40  ·  view source on GitHub ↗
(m, l, phi, theta)

Source from the content-addressed store, hash-verified

30 (4 * math.pi * math.factorial(l + m)))
31
32def SH(m, l, phi, theta):
33 if m == 0:
34 return SH_renormalization(l, m) * associated_legendre_polynomial(l, m, torch.cos(theta))
35 elif m > 0:
36 return math.sqrt(2.0) * SH_renormalization(l, m) * \
37 torch.cos(m * phi) * associated_legendre_polynomial(l, m, torch.cos(theta))
38 else:
39 return math.sqrt(2.0) * SH_renormalization(l, -m) * \
40 torch.sin(-m * phi) * associated_legendre_polynomial(l, -m, torch.cos(theta))

Callers 2

SH_Function · 0.85
__init__Method · 0.85

Calls 2

SH_renormalizationFunction · 0.85

Tested by

no test coverage detected