GAMMA-UMD / pygsound

Impulse response generation based on state-of-the-art geometric sound propagation engine.
Other
140 stars 21 forks source link

About theta and phi in directivity definition #37

Open kirinf opened 1 year ago

kirinf commented 1 year ago

Dear author,

https://github.com/GAMMA-UMD/pygsound/blob/8f41cb13da5dba9aa09cac3f42e668005ed5cf11/src/GSound/gsound/gsSoundDirectivity.cpp#L152C1-L179C160

In gsSoundDirectivity.cpp, According to the Macro definition of SPHERICAL( theta, phi ), it's

[0, 0, 1; 0, 1, 0; 1, 0, 0] [ sin(theta) cos(phi), sin(theta)sin(phi), cos(theta) ]' = [ cos(theta), sin(theta)sin(phi), sin(theta) * cos(phi) ]',

which means x = cos(theta), y = sin(theta)sin(phi), z = sin(theta) cos(phi).

So I think theta represents angle between ray and X-axis; phi represents angle between ray's projection in YZ plane and Z-axis (as shown in the figure below).

Is my understanding correct?

9fd1d0a1a4cc2bd88b2ddb8e3db5770