User:AboutFace 22/sandbox2

I have a 2-sphere and I want to define 2 rectangular areas on it. They are "spherical rectangles" with borders that are some meridians and parallels. Sorry for not using Greek letters all the way through-they refused to take subscripts, superscripts. Let angle θ  be the inclination (polar) angle, and angle φ  the azimuthal angle. I will use Greek and Latin letters interchangeably. I need three angles t: $$0 < t_1 < t_2 < t_3 < 90^o$$ and two angles f: $$0 < f_1 < f_2 < 360^o$$ It is clear they define two contiguous (adjacent) spherical rectangles. The rectangles touch each other on $$t_2$$ parallel. A function f(θ,φ) is defined on the area that is the sum of both rectangles. The portions of the function f(θ,φ) on both rectangles are different. Let $$f_1$$(θ,φ) be the portion of the function f(θ,φ) on one rectangle and $$f_2$$(θ,φ) the corresponding portion on the other rectangle. A basis of fully normalized Spherical Functions

is defined on the whole 2-sphere but I will consider only the portion that is covered by the above two rectangles. Each function $$f_1$$(θ,φ), $$f_2$$(θ,φ) and $$f$$(θ,φ) will be expressed as

and

I then fix one particular index $${l}$$ which defines a subspace in the functional Hilbert space and compute these expressions (asterisk marks complex conjugate):

It is very important for me to know if additivity is preserved and



BIPOLAR SPHERICAL HARMONICS ; pg 160

I need to expand my research into Bipolar Spherical Harmonics (BiPoSH). It is regretful that Wikipedia does not have an article on them. They are used in Quantum Theory of Angular Momentum, studies of CMB isotropy violations  and X-Ray computerized tomography. In order to formulate my questions I need to display a few known formulas.

This is the definition for regular Spherical Harmonics


 * $$\mathrm{N}_l^m$$ is a normalization factor.

The BiPoSH:

Where:


 * $$\parallel\boldsymbol{\xi}\parallel = \parallel\boldsymbol{\theta}\parallel = 1.0$$

are two unit vectors on 2-sphere and


 * $$-l_{\mathfrak{1}}\leqslant m_{\mathfrak{1}}\leqslant l_{\mathfrak{1}}$$
 * $$-l_{\mathfrak{2}}\leqslant m_{\mathfrak{2}}\leqslant l_{\mathfrak{2}}$$

and


 * $$\mathfrak{C}_{l_{\mathfrak{1}}m_{\mathfrak{1}}l_{\mathfrak{2}}m_{\mathfrak{2}}}^{LM}$$ are Clebsh-Gordan Coefficients

The condition for Clebsch-Gordan coefficients being non-zero:

I understand that (page 178):


 * $$\parallel l_{\mathfrak{1}}-l_{\mathfrak{2}}\parallel \leqslant L \leqslant l_{\mathfrak{1}}+l_{\mathfrak{2}}$$

It's been said that bipolar spherical harmonics constitute an orthonormal basis on $$L_{\mathfrak{2}}(\mathbb{S}^{\mathfrak{2}} \times\mathbb{S}^{\mathfrak{2}})$$ and therefore any function


 * $$\mathfrak{f}(\boldsymbol{\xi},\boldsymbol{\theta})\in L_{\mathfrak{2}}(\mathbb{S}^{\mathfrak{2}} \times\mathbb{S}^{\mathfrak{2}})$$

can be expanded into a series of bipolar spherical harmonics:


 * $$\mathfrak{g}_{l_{\mathfrak{1}}l_{\mathfrak{2}}LM}$$ are expansion coefficients

Direct expression for expansion coefficients:

also gives this expression for expansion coefficients (pg 3, formula 4):

and so called "unbiased (in terms of CMB statistics) estimator:"

The following expression

will be invariant under rotations


 * TRIPOLAR SPHERICAL HARMONICS

Tripolar Spherical Harmonics are defined as a tensor product of three ordinary Spherical harmonics; Ref {1} pg 161

$$Y_{l_1 m_1}(\theta_1 \psi_1)Y_{l_2 m_2}(\theta_2 \psi_2)Y_{l_3 m_3}(\theta_3 \psi_3)$$

where:

$$\boldsymbol{\zeta} \equiv (\theta_{1},\phi_{1}); ~\boldsymbol{\mu} \equiv (\theta_2, \phi_2); ~\boldsymbol{\lambda} \equiv (\theta_3,\phi_3)$$ are three unit vectors on 2-sphere

And $$\mathfrak{C}$$ are Clebsch-Gordan coefficients

Integers $$L, l_1 l_2 l_3 l_{23}$$ have such limitations:

Tripolar Spherical Harmonics form a complete orthonormal basis for functions defined on 2-sphere in such a way that they depend on three vectors $$ \mathbf{|r_1| = 1}, \mathbf{|r_2| = 1}, \mathbf{|r_3| = 1}$$

Then the expansion of a function $$\xi(\mathbf{r_1}, \mathbf{r_2},\mathbf{r_3})$$ will take this form:

Where $$\mathfrak{G}$$ are complex valued expansion coefficients of the function dependent on three vectors on 2-sphere.

Where $$\xi(\mathbf{r_1}, \mathbf{r_2},\mathbf{r_3})$$ is a real-valued function defined on 2-sphere and dependent on three not necessarily linearly independent vectors

The expression

will be invariant under rotations.



In CMB research they have by necessity only one sphere and the unit vectors $$\boldsymbol{\xi},\boldsymbol{\theta}$$ are chosen arbitrarily and the correlations are examined between resulting coefficients.

My task necessitates me to apply the Translation Operator (pg. 142) first to a set of Spherical Harmonics and then forming the tensor product of the original and shifted Spherical Harmonics.


 * $$\times \left (\frac {a}{r^\prime}\right)^{l^\prime} \left (\frac {r}{a}\right)^{l}  \left \{\mathrm{Y}_l(\theta,\phi) \otimes \mathrm{Y}_{l^\prime-l}(\Theta,\Phi) \right \}_{l^\prime m^\prime}$$


 * $$\hat {T}(a) = e^{-\mathbf{\vec{a}}\nabla}$$ is the shift operator.


 * $$\left \{\mathrm{Y}_l(\theta,\phi) \otimes \mathrm{Y}_{l^\prime-l}(\Theta,\Phi) \right \}_{l^\prime m^\prime}$$ is an irreducible tensor product.

Quadrature rules based on interpolating functions
A large class of quadrature rules can be derived by constructing interpolating functions that are easy to integrate. Typically these interpolating functions are polynomials. In practice, since polynomials of very high degree tend to oscillate wildly, only polynomials of low degree are used, typically linear and quadratic.

The simplest method of this type is to let the interpolating function be a constant function (a polynomial of degree zero) that passes through the point ((a+b)/2, f((a+b)/2)). This is called the midpoint rule or rectangle rule.


 * $$\int_a^b f(x)\,dx \approx (b-a) \, f\left(\frac{a+b}{2}\right).$$

The interpolating function may be a straight line (an affine function, i.e. a polynomial of degree 1) passing through the points (a, f(a)) and (b, f(b)). This is called the trapezoidal rule.


 * $$\int_a^b f(x)\,dx \approx (b-a) \, \left(\frac{f(a) + f(b)}{2}\right).$$

For either one of these rules, we can make a more accurate approximation by breaking up the interval [a, b] into some number n of subintervals, computing an   approximation for each subinterval, then adding up all the results. This is called a composite rule, extended rule, or iterated rule. For example, the Composite Trapezoidal rule can be stated as

where the subintervals have the form [k h, (k+1) h], with h = (b−a)/n and k = 0, 1, 2, ..., n−1.

Interpolation with polynomials evaluated at equally spaced points in [a, b] yields the Newton–Cotes formulas, of which the rectangle rule and the trapezoidal rule are examples. Simpson's rule, which is based on a polynomial of order 2, is also a Newton–Cotes formula.

Quadrature rules with equally spaced points have the very convenient property of nesting. The corresponding rule with each interval subdivided includes all the current points, so those integrand values can be re-used.

If we allow the intervals between interpolation points to vary, we find another group of quadrature formulas, such as the Gaussian quadrature formulas. A Gaussian quadrature rule is typically more accurate than a Newton–Cotes rule, which requires the same number of function evaluations, if the integrand is smooth (i.e., if it is sufficiently differentiable). Other quadrature methods with varying intervals include Clenshaw–Curtis quadrature (also called Fejér quadrature) methods, which do nest.

Gaussian quadrature rules do not nest, but the related Gauss–Kronrod quadrature formulas do.

Applying the Gaussian quadrature rule then results in the following approximation:


 * $$\int_a^b f(x)\,dx \approx \frac{b-a}{2} \sum_{i=1}^n w_i f\left(\frac{b-a}{2}x_i + \frac{a+b}{2}\right).$$

Quadratic interpolation
One derivation replaces the integrand $$f(x)$$ by the quadratic polynomial (i.e. parabola)$$P(x)$$ which takes the same values as $$f(x)$$ at the end points a and b and the midpoint m = (a + b) / 2.


 * $$ \int_{a}^{b} P(x) \, dx =\tfrac{b-a}{6}\left[f(a) + 4f\left(\tfrac{a+b}{2}\right)+f(b)\right].$$

This calculation can be carried out more easily if one first observes that (by scaling) there is no loss of generality in assuming that $$a=-1$$ and $$b=1$$.






 * EXAMPLES OF SIMPLE DEFINITE INTEGRALS TO VERIFY SOME SUBROUTINES

Calculation of sample definite integrals (some presented below) has been done by using three methods: (1) Simple Newton's integration (2) Composite Trapezoidal rule, formula (17) above, and (3) 'Gauss-Legendre integration by using Holoborodko's abscissas and weights (16 x 2 = 32 points). The result showed that Gauss-Legendre is more accurate than the other two by perhaps hundreds or thousands of times.

Градштейн & Рыжик 3.121(2)

Paul's online math notes

Source

Interactive Mathematics

Градштейн & Рыжик 3.716(2, etc.)

Legendre Polynomials & Associated Legendre Polynomials positional diagram:

$$\dots\dots\dots\dots\dots\dots\dots\dots\dots\dots\dots\dots\dots$$

$$\Bigg \uparrow \color{Red}\hat{P}_l\color{Black}\hat{P}_l^1\hat{P}_l^2\dots\dots\dots\dots \hat{P}_l^{l-1}~\color{Green}\hat{P}_l^l ~\color{Black}\Bigg/$$

$$\Bigg \uparrow \color{Red}\hat{P}_{l-1}\color{Black}\hat{P}_{l-1}^1\hat{P}_{l-1}^2\dots\dots \hat{P}_{l-1}^{l-2}~\color{Green}\hat{P}_{l-1}^{l-1}\color{Black}\Bigg/$$

$$\Bigg \uparrow \color{Red}\hat{P}_{l-2}\color{Black}\hat{P}_{l-2}^1\hat{P}_{l-2}^2\dots\dots\dots \color{Green}\hat{P}_{l-2}^{l-2}\color{Black}\Bigg/$$

$$\Bigg \uparrow\dots\dots\dots\dots\dots\dots\dots\dots\Bigg/$$

$$\Bigg \uparrow \color{Red}\hat{P}_8~\color{Black}\hat{P}_8^1\dots\dots\dots~\color{Green}\hat{P}_8^8\color{Black}\Bigg/$$

$$\Bigg \uparrow \color{Red}\hat{P}_7~\color{Black}\hat{P}_7^1\dots\dots~ \color{Green}\hat{P}_7^7\color{Black}\Bigg/$$

Associated Legendre Polynomials of indexes 1 to 8 are published They are being used for the seeds of recurrence formulas presented in Sandbox. First they must be normalized; simple formulas for that exist. The calculated values match those in Tables of Normalized Associated Legendre Polynomials by S.L. Belousov

Calculation of Normalized Legendre polynomials, accurate up to $$l=$$ 1600 and $$m=$$ 800 can be done two-fold. The first method employs formula [50] in Sandbox.


 * MOVING FROM LEFT TO RIGHT

The seeds for this formula are $$\color{red}\hat{P}_7$$ and $$\color{red}\hat{P}_8$$

[50] is implemented as ********. Matches Belousov's values. On the above diagram that will involve scaling up the Red ladder. The result will give us the first seed.

In order to move horizontally from Left to the Right by using the formula [57] two seed values are needed, $$\hat{P}_l$$ and $$\hat{P}^1_l$$

The following formula [57] allows to move horizontally from left to right for indexes $$m$$. The formula needs two seeds: $$\hat{P}_l$$ and $$\hat{P}^1_l$$. The first value is provided by formula [50] and the second value by this formula [71]:


 * MOVING FROM RIGHT TO LEFT

The following formula allows to climb the Green ladder and eventually compute $$\hat{P}_l^l$$ polynomial

[45] is implemented as highOrder_ALP_LeqM_Norm. Matches Belousov's values. [45] will give us the first seed for [62]. Formula [75] will give the second seed.

The following formula [62] allows moving from Right to Left, in direction of decreasing $$m$$ index:

$$j = 2$$ for $$m = 0$$ and $$j = 1$$ for $$m > 0~$$

!!!==================================!!!

In the following table $$x \equiv cos\theta$$ and $$s \equiv sin\theta$$

!!!==================================!!! If the normal of the viewing plane (the camera direction) is parallel to one of the primary axes (which is the x, y, or z axis), the mathematical transformation is as follows; To project the 3D point $$a_x$$, $$a_y$$, $$a_z$$ onto the 2D point $$b_x$$, $$b_y$$ using an orthographic projection parallel to the y axis (where positive y represents forward direction - profile view), the following equations can be used:
 * 3-D PROJECTION (Wikipedia)

b_x = s_x a_x + c_x $$

b_y = s_z a_z + c_z $$ where the vector s is an arbitrary scale factor, and c is an arbitrary offset. These constants are optional, and can be used to properly align the viewport. Using matrix multiplication, the equations become:

\begin{bmatrix} {b_x } \\ {b_y } \\ \end{bmatrix} = \begin{bmatrix} {s_x } & 0 & 0 \\ 0 & 0 & {s_z } \\ \end{bmatrix}\begin{bmatrix} {a_x } \\ {a_y } \\ {a_z } \\ \end{bmatrix} + \begin{bmatrix} {c_x } \\ {c_z } \\ \end{bmatrix} $$.

The perspective projection requires a more involved definition as compared to orthographic projections. A conceptual aid to understanding the mechanics of this projection is to imagine the 2D projection as though the object(s) are being viewed through a camera viewfinder. The camera's position, orientation, and field of view control the behavior of the projection transformation. The following variables are defined to describe this transformation: Which results in:
 * PERSPECTIVE PROJECTION
 * $$\mathbf{a}_{x,y,z}$$ - the 3D position of a point A that is to be projected.
 * $$\mathbf{c}_{x,y,z}$$ - the 3D position of a point C representing the camera.
 * $$\mathbf{\theta}_{x,y,z}$$ - The orientation of the camera (represented by Tait–Bryan angles).
 * $$\mathbf{e}_{x,y,z}$$ - the viewer's position relative to the display surface which goes through point C representing the camera.
 * $$\mathbf{b}_{x,y}$$ - the 2D projection of $$\mathbf{a}$$.

When $$\mathbf{c}_{x,y,z}=\langle 0,0,0\rangle,$$ and $$\mathbf{\theta}_{x,y,z} = \langle 0,0,0\rangle,$$ the 3D vector $$\langle 1,2,0 \rangle$$ is projected to the 2D vector $$\langle 1,2 \rangle$$.

Otherwise, to compute $$\mathbf{b}_{x,y}$$ we first define a vector $$\mathbf{d}_{x,y,z}$$ as the position of point A with respect to a coordinate system defined by the camera, with origin in C and rotated by $$\mathbf{\theta}$$ with respect to the initial coordinate system. This is achieved by subtracting $$\mathbf{c}$$ from $$\mathbf{a}$$ and then applying a rotation by $$-\mathbf{\theta}$$ to the result. This transformation is often called a , and can be expressed as follows, expressing the rotation in terms of rotations about the x, y, and z axes (these calculations assume that the axes are ordered as a left-handed system of axes):

\begin{bmatrix} \mathbf{d}_x \\ \mathbf{d}_y \\ \mathbf{d}_z \\ \end{bmatrix}=\begin{bmatrix} 1 & 0 & 0 \\   0 & {\cos ( \mathbf{ \theta}_x ) } & {  \sin ( \mathbf{ \theta}_x ) }  \\ 0 & {- \sin ( \mathbf{ \theta}_x ) } & { \cos ( \mathbf{ \theta}_x ) } \\ \end{bmatrix}\begin{bmatrix} { \cos ( \mathbf{ \theta}_y ) } & 0 & {- \sin ( \mathbf{ \theta}_y ) } \\ 0 & 1 & 0 \\   { \sin ( \mathbf{ \theta}_y ) } & 0 & { \cos ( \mathbf{ \theta}_y ) }  \\ \end{bmatrix}\begin{bmatrix} { \cos ( \mathbf{ \theta}_z ) } & { \sin ( \mathbf{ \theta}_z ) } & 0  \\ { -\sin ( \mathbf{ \theta}_z ) } & { \cos ( \mathbf{ \theta}_z ) } & 0 \\ 0 & 0 & 1 \\ \end{bmatrix}\left( {\begin{bmatrix}   \mathbf{a}_x  \\   \mathbf{a}_y  \\   \mathbf{a}_z  \\ \end{bmatrix} - \begin{bmatrix}   \mathbf{c}_x  \\   \mathbf{c}_y  \\   \mathbf{c}_z  \\ \end{bmatrix}} \right) $$ This representation corresponds to rotating by three Euler angles (more properly, Tait–Bryan angles), using the xyz convention, which can be interpreted either as "rotate about the extrinsic axes (axes of the scene) in the order z, y, x (reading right-to-left)" or "rotate about the intrinsic axes (axes of the camera) in the order x, y, z (reading left-to-right)". Note that if the camera is not rotated ($$\mathbf{\theta}_{x,y,z} = \langle 0,0,0\rangle$$), then the matrices drop out (as identities), and this reduces to simply a shift: $$\mathbf{d} = \mathbf{a} - \mathbf{c}.$$

Alternatively, without using matrices (let's replace (ax-cx) with x and so on, and abbreviate cosθ to c and sinθ to s):

\begin{array}{lcl} \mathbf{d}_x = c_y (s_z \mathbf{y}+c_z \mathbf{x})-s_y \mathbf{z} \\ \mathbf{d}_y = s_x (c_y \mathbf{z}+s_y (s_z \mathbf{y}+c_z \mathbf{x}))+c_x (c_z \mathbf{y}-s_z \mathbf{x}) \\ \mathbf{d}_z = c_x (c_y \mathbf{z}+s_y (s_z \mathbf{y}+c_z \mathbf{x}))-s_x (c_z \mathbf{y}-s_z \mathbf{x}) \\ \end{array} $$ This transformed point can then be projected onto the 2D plane using the formula (here, x/y is used as the projection plane; literature also may use x/z):

\begin{array}{lcl} \mathbf{b}_x &= & \frac{\mathbf{e}_z}{\mathbf{d}_z} \mathbf{d}_x - \mathbf{e}_x \\ \mathbf{b}_y &= & \frac{\mathbf{e}_z}{\mathbf{d}_z} \mathbf{d}_y - \mathbf{e}_y\\ \end{array}. $$

Or, in matrix form using homogeneous coordinates, the system

\begin{bmatrix} \mathbf{f}_x \\ \mathbf{f}_y \\ \mathbf{f}_z \\ \mathbf{f}_w \\ \end{bmatrix}=\begin{bmatrix} 1 & 0 & -\frac{\mathbf{e}_x}{\mathbf{e}_z} & 0 \\ 0 & 1 & -\frac{\mathbf{e}_y}{\mathbf{e}_z} & 0 \\ 0 & 0 & 1 & 0 \\  0 & 0 & -\frac{1}{\mathbf{e}_z} & 1 \\ \end{bmatrix}\begin{bmatrix} \mathbf{d}_x \\ \mathbf{d}_y \\ \mathbf{d}_z \\ 1 \\ \end{bmatrix} $$ in conjunction with an argument using similar triangles, leads to division by the homogeneous coordinate, giving

\begin{array}{lcl} \mathbf{b}_x &= &\mathbf{f}_x / \mathbf{f}_w \\ \mathbf{b}_y &= &\mathbf{f}_y / \mathbf{f}_w \\ \end{array}. $$

The distance of the viewer from the display surface, $$\mathbf{e}_z$$, directly relates to the field of view, where $$\alpha=2 \cdot \tan^{-1}(1/\mathbf{e}_z)$$ is the viewed angle. (Note: This assumes that you map the points (-1,-1) and (1,1) to the corners of your viewing surface)

The above equations can also be rewritten as:

\begin{array}{lcl} \mathbf{b}_x= (\mathbf{d}_x \mathbf{s}_x ) / (\mathbf{d}_z \mathbf{r}_x) \mathbf{r}_z\\ \mathbf{b}_y= (\mathbf{d}_y \mathbf{s}_y ) / (\mathbf{d}_z \mathbf{r}_y) \mathbf{r}_z\\ \end{array}. $$ In which $$\mathbf{s}_{x,y}$$ is the display size, $$\mathbf{r}_{x,y}$$ is the recording surface size (CCD or film), $$\mathbf{r}_z$$ is the distance from the recording surface to the entrance pupil (camera center), and $$\mathbf{d}_z$$ is the distance, from the 3D point being projected, to the entrance pupil.

Subsequent clipping and scaling operations may be necessary to map the 2D plane onto any particular display media.

!!!==================================!!!


 * EXAMPLE OF 10-POINTS GAUSS-LEGENDRE INTEGRATION
 * ABSCISSAS

\begin{bmatrix} -0.972906528517 \\ -0.865063366689 \\ -0.679409568295 \\ -0.433395394129 \\ -0.148874338982 \\ 0.148874338982 \\ 0.433395394129 \\ 0.679409568295 \\ 0.865063366689 \\ 0.972906528517 \end{bmatrix} $$


 * WEIGHTS

\begin{bmatrix} 0.0666713443087 \\ 0.149451349151 \\ 0.219086362516 \\ 0.26926671931 \\ 0.295524224715 \\ 0.295524224715 \\ 0.26926671931 \\ 0.219086362516 \\ 0.149451349151 \\ 0.0666713443087 \end{bmatrix} $$


 * BIBLIOGRAPHY

{1} D.A. Varshalovich, A.N. Moskalev, V.K Khersonskii Quantum Theory of Angular Momentum, 1988 World Scientific

{2} Nidhi Joshi, Aditya Rotti, and Tarun Souradeep Statistics of Bipolar Representation of CMB maps; Phys. Rev. D, Vol. 85, 043004, 2012

{3} I.S. Gradshteyn, I.M. Ryzhik Tables of Integrals, Series and Products; Seventh Edition; Academic Press 2007

{4} Istva´n Szapudi Wide Angle Redshift Distortions Revisited The Astrophysical Journal, 614:51–55, 2004 October 10

{5} Table of Spherical Harmonics, Wikipedia.org