Normalization of an angle distribution in cartesian coordinates

Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
Quick contextualisation, I am trying to follow the orientation of a molecule (represented as a rigid object) in respect to the z axis. The molecule is basically shaped as an hexagon, so what i thought was to define 2 vectors: $vec u$ running from one vertex to the opposite one of the hexagon and a $vec v $, orthogonal to $vec u$ . What i do then is simply measuring their angle with the z axis, which i call respectively $theta$ and $psi$ and counting the number of occurence of every couple ( $theta$ , $psi$ ). With that i fill a 180x180 matrix with the number of occurence of every couple, then divide by the total number of observations. When i plot this matrix i get a typically shaped diamond plot with the probability on the edges showing higher values due to the correlation of the two vectors and the geometrical density of the states (and with this i mean the that the angle of a vector with a fixed axes has a non uniform density distribution).
The specific thing that i'm looking for is to correct for this "geometrical" effect so that when the molecule is freely rotating in respect to the z axis then the 3D plot of the angle probability looks "flat" inside the diamond, or if you want "even".
To better explain, if i was to measure just the probability of occurence of one angle, say $theta$, i would divide every probability value of $theta$ by the $sin(theta)$ to "correct" for the geometrical effect, and than the plot would be evened out (although ofc at 0 you have sin(0)=0 which creates a problem which is still solvable by binning). But if i have two angles i guess a conditional probability is necessary to normalize my distribution since $theta$ and $psi$ are not independent, and i can't get my head around what it should be.
Can anyone help by any chance? I attach an image of the angle map that i get and that i would want to flat out:
Edit: After correction i get the map flattened as wanted. The peaks i think are due to the machine calculation of the radicand which is not perfect.


probability geometry angle
add a comment |Â
up vote
2
down vote
favorite
Quick contextualisation, I am trying to follow the orientation of a molecule (represented as a rigid object) in respect to the z axis. The molecule is basically shaped as an hexagon, so what i thought was to define 2 vectors: $vec u$ running from one vertex to the opposite one of the hexagon and a $vec v $, orthogonal to $vec u$ . What i do then is simply measuring their angle with the z axis, which i call respectively $theta$ and $psi$ and counting the number of occurence of every couple ( $theta$ , $psi$ ). With that i fill a 180x180 matrix with the number of occurence of every couple, then divide by the total number of observations. When i plot this matrix i get a typically shaped diamond plot with the probability on the edges showing higher values due to the correlation of the two vectors and the geometrical density of the states (and with this i mean the that the angle of a vector with a fixed axes has a non uniform density distribution).
The specific thing that i'm looking for is to correct for this "geometrical" effect so that when the molecule is freely rotating in respect to the z axis then the 3D plot of the angle probability looks "flat" inside the diamond, or if you want "even".
To better explain, if i was to measure just the probability of occurence of one angle, say $theta$, i would divide every probability value of $theta$ by the $sin(theta)$ to "correct" for the geometrical effect, and than the plot would be evened out (although ofc at 0 you have sin(0)=0 which creates a problem which is still solvable by binning). But if i have two angles i guess a conditional probability is necessary to normalize my distribution since $theta$ and $psi$ are not independent, and i can't get my head around what it should be.
Can anyone help by any chance? I attach an image of the angle map that i get and that i would want to flat out:
Edit: After correction i get the map flattened as wanted. The peaks i think are due to the machine calculation of the radicand which is not perfect.


probability geometry angle
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Quick contextualisation, I am trying to follow the orientation of a molecule (represented as a rigid object) in respect to the z axis. The molecule is basically shaped as an hexagon, so what i thought was to define 2 vectors: $vec u$ running from one vertex to the opposite one of the hexagon and a $vec v $, orthogonal to $vec u$ . What i do then is simply measuring their angle with the z axis, which i call respectively $theta$ and $psi$ and counting the number of occurence of every couple ( $theta$ , $psi$ ). With that i fill a 180x180 matrix with the number of occurence of every couple, then divide by the total number of observations. When i plot this matrix i get a typically shaped diamond plot with the probability on the edges showing higher values due to the correlation of the two vectors and the geometrical density of the states (and with this i mean the that the angle of a vector with a fixed axes has a non uniform density distribution).
The specific thing that i'm looking for is to correct for this "geometrical" effect so that when the molecule is freely rotating in respect to the z axis then the 3D plot of the angle probability looks "flat" inside the diamond, or if you want "even".
To better explain, if i was to measure just the probability of occurence of one angle, say $theta$, i would divide every probability value of $theta$ by the $sin(theta)$ to "correct" for the geometrical effect, and than the plot would be evened out (although ofc at 0 you have sin(0)=0 which creates a problem which is still solvable by binning). But if i have two angles i guess a conditional probability is necessary to normalize my distribution since $theta$ and $psi$ are not independent, and i can't get my head around what it should be.
Can anyone help by any chance? I attach an image of the angle map that i get and that i would want to flat out:
Edit: After correction i get the map flattened as wanted. The peaks i think are due to the machine calculation of the radicand which is not perfect.


probability geometry angle
Quick contextualisation, I am trying to follow the orientation of a molecule (represented as a rigid object) in respect to the z axis. The molecule is basically shaped as an hexagon, so what i thought was to define 2 vectors: $vec u$ running from one vertex to the opposite one of the hexagon and a $vec v $, orthogonal to $vec u$ . What i do then is simply measuring their angle with the z axis, which i call respectively $theta$ and $psi$ and counting the number of occurence of every couple ( $theta$ , $psi$ ). With that i fill a 180x180 matrix with the number of occurence of every couple, then divide by the total number of observations. When i plot this matrix i get a typically shaped diamond plot with the probability on the edges showing higher values due to the correlation of the two vectors and the geometrical density of the states (and with this i mean the that the angle of a vector with a fixed axes has a non uniform density distribution).
The specific thing that i'm looking for is to correct for this "geometrical" effect so that when the molecule is freely rotating in respect to the z axis then the 3D plot of the angle probability looks "flat" inside the diamond, or if you want "even".
To better explain, if i was to measure just the probability of occurence of one angle, say $theta$, i would divide every probability value of $theta$ by the $sin(theta)$ to "correct" for the geometrical effect, and than the plot would be evened out (although ofc at 0 you have sin(0)=0 which creates a problem which is still solvable by binning). But if i have two angles i guess a conditional probability is necessary to normalize my distribution since $theta$ and $psi$ are not independent, and i can't get my head around what it should be.
Can anyone help by any chance? I attach an image of the angle map that i get and that i would want to flat out:
Edit: After correction i get the map flattened as wanted. The peaks i think are due to the machine calculation of the radicand which is not perfect.


probability geometry angle
edited Aug 22 at 4:51
asked Aug 15 at 6:26
user3458909
154
154
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Here's a new answer, based on the clarifications in the comments below.
You clarified that what you're interested in isn't really normalization, but rather a reference density that would be expected for a free molecule so that you can divide this out in order to visualize effects that cause deviations from this free-molecule density.
Let's regard the molecule as fixed and the reference axis for $theta$ and $psi$ as freely rotating; that is, let's view the angles $theta$ and $psi$ as the angles that two fixed orthogonal vectors form with a uniformly random direction. Let the fixed $x$ and $y$ axes point along the two orthogonal vectors. A uniformly random unit direction vector has independent uniform distributions of $z$ over $[-1,1]$ and of $phi$ (the angle about the $z$ axis) over $[0,2pi]$. (Here the $z$ axis is not the random reference axis, but the fixed coordinate axis orthogonal to the $x$ and $y$ axes.) The transformation from $z,phi$ to $x,y$ is
$$
x=sqrt1-z^2cosphi;,\
y=sqrt1-z^2sinphi;.
$$
Thus
begineqnarray*
fracpartial(x,y)partial(z,phi)
&=&left|matrixfracpartial xpartial z&fracpartial xpartialphi\fracpartial ypartial z&fracpartial ypartialphiright|
\
&=&left|matrixfrac zsqrt1-z^2cosphi&-sqrt1-z^2sinphi\frac zsqrt1-z^2sinphi&sqrt1-z^2cosphiright|
\
&=&
z
\
&=&
sqrt1-x^2-y^2;.
endeqnarray*
The further transform according to $x=costheta$ and $y=cospsi$ has Jacobian
$$
fracpartial(x,y)partial(theta,psi)=sinthetasinpsi;,
$$
so in all we have
$$
fracpartial(z,phi)partial(theta,psi)=fracsinthetasinpsisqrt1-cos^2theta-cos^2psi;.
$$
This is the factor you need to divide by, since the density for $z$ and $phi$ is flat (as these variables are independently uniformly distributed), and the densities are releated by
$$
f_z,phi(z,phi)mathrm dzmathrm dphi=f_theta,psi(theta,psi)mathrm dthetamathrm dpsi
$$
and thus
$$
f_theta,psi(theta,psi)=fracpartial(z,phi)partial(theta,psi)f_z,phi(z,phi)proptofracpartial(z,phi)partial(theta,psi);.
$$
Here $theta$ and $psi$ are limited to values for which the radicand in the denominator is non-negative, that is, to the diamond
$$
left|,theta-fracpi2right|+left|,psi-fracpi2right|lefracpi2;.
$$
This result fits with your image. It's restricted to the diamond; it shows roughly a $sinthetasinpsi$ behaviour along the boundary; and the divergence at the boundary (mitigated by your binning procedure) is recognizable.
1
@user3458909: Ah, I think I finally understood what you want to do :-). You really do want a flat distribution inside the rhombus for the orthogonal freely rotating molecule, not because it's actually flat but because you want to be able see the other effects stand out from a flat reference. (Part of the misunderstanding was that I thought that by "density of states" you were referring to a physical effect, but it seems you meant the geometric effect that you're trying to divide out.) (I studied physics a long time ago, by the way. :-)
â joriki
Aug 15 at 9:53
1
@user3458909: a) No; it's a nice feature of a sphere in three dimensions that it has equal surface area in slices of equal height; see e.g. here and here. More generally, in $n$ dimensions a slice of a hypersphere of height $mathrm dz$ has surface proportional to $sin^n-2thetafracmathrm dzsintheta=sin^n-3thetamathrm dz$, and it just so happens that the dependence on $theta$ vanishes for $n=3$.
â joriki
Aug 17 at 4:22
1
@user3458909: b) I think the best thing to search for here is "spherical coordinates" (e.g. at Wikipedia). If $x=sinthetacosphi$, $y=sinthetasinphi$ and $z=costheta$, then $sintheta=sqrt1-cos^2theta=sqrt1-z^2$ and thus $x=sqrt1-z^2cosphi$. Also, unfortunately I don't drink beer :-) But thanks anyway!
â joriki
Aug 17 at 4:22
1
@user3458909: Further to a): This is actually exactly why you'd divide by $sintheta$ if you'd look only at the angle a single vector forms with the $z$ axis: $z=costheta$ is uniformly distributed, and the Jacobian $fracmathrm dzmathrm dtheta$ is $sintheta$, so if you take the density for $theta$, it becomes flat if you divide it by $sintheta$, since you thereby transform it into the uniform density for $z$.
â joriki
Aug 17 at 4:34
1
Perfect, i think that's all that i had to understand, thank you SO MUCH. I'll now code it and eventually put up an image of the flattened map!
â user3458909
Aug 20 at 8:00
 |Â
show 27 more comments
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Here's a new answer, based on the clarifications in the comments below.
You clarified that what you're interested in isn't really normalization, but rather a reference density that would be expected for a free molecule so that you can divide this out in order to visualize effects that cause deviations from this free-molecule density.
Let's regard the molecule as fixed and the reference axis for $theta$ and $psi$ as freely rotating; that is, let's view the angles $theta$ and $psi$ as the angles that two fixed orthogonal vectors form with a uniformly random direction. Let the fixed $x$ and $y$ axes point along the two orthogonal vectors. A uniformly random unit direction vector has independent uniform distributions of $z$ over $[-1,1]$ and of $phi$ (the angle about the $z$ axis) over $[0,2pi]$. (Here the $z$ axis is not the random reference axis, but the fixed coordinate axis orthogonal to the $x$ and $y$ axes.) The transformation from $z,phi$ to $x,y$ is
$$
x=sqrt1-z^2cosphi;,\
y=sqrt1-z^2sinphi;.
$$
Thus
begineqnarray*
fracpartial(x,y)partial(z,phi)
&=&left|matrixfracpartial xpartial z&fracpartial xpartialphi\fracpartial ypartial z&fracpartial ypartialphiright|
\
&=&left|matrixfrac zsqrt1-z^2cosphi&-sqrt1-z^2sinphi\frac zsqrt1-z^2sinphi&sqrt1-z^2cosphiright|
\
&=&
z
\
&=&
sqrt1-x^2-y^2;.
endeqnarray*
The further transform according to $x=costheta$ and $y=cospsi$ has Jacobian
$$
fracpartial(x,y)partial(theta,psi)=sinthetasinpsi;,
$$
so in all we have
$$
fracpartial(z,phi)partial(theta,psi)=fracsinthetasinpsisqrt1-cos^2theta-cos^2psi;.
$$
This is the factor you need to divide by, since the density for $z$ and $phi$ is flat (as these variables are independently uniformly distributed), and the densities are releated by
$$
f_z,phi(z,phi)mathrm dzmathrm dphi=f_theta,psi(theta,psi)mathrm dthetamathrm dpsi
$$
and thus
$$
f_theta,psi(theta,psi)=fracpartial(z,phi)partial(theta,psi)f_z,phi(z,phi)proptofracpartial(z,phi)partial(theta,psi);.
$$
Here $theta$ and $psi$ are limited to values for which the radicand in the denominator is non-negative, that is, to the diamond
$$
left|,theta-fracpi2right|+left|,psi-fracpi2right|lefracpi2;.
$$
This result fits with your image. It's restricted to the diamond; it shows roughly a $sinthetasinpsi$ behaviour along the boundary; and the divergence at the boundary (mitigated by your binning procedure) is recognizable.
1
@user3458909: Ah, I think I finally understood what you want to do :-). You really do want a flat distribution inside the rhombus for the orthogonal freely rotating molecule, not because it's actually flat but because you want to be able see the other effects stand out from a flat reference. (Part of the misunderstanding was that I thought that by "density of states" you were referring to a physical effect, but it seems you meant the geometric effect that you're trying to divide out.) (I studied physics a long time ago, by the way. :-)
â joriki
Aug 15 at 9:53
1
@user3458909: a) No; it's a nice feature of a sphere in three dimensions that it has equal surface area in slices of equal height; see e.g. here and here. More generally, in $n$ dimensions a slice of a hypersphere of height $mathrm dz$ has surface proportional to $sin^n-2thetafracmathrm dzsintheta=sin^n-3thetamathrm dz$, and it just so happens that the dependence on $theta$ vanishes for $n=3$.
â joriki
Aug 17 at 4:22
1
@user3458909: b) I think the best thing to search for here is "spherical coordinates" (e.g. at Wikipedia). If $x=sinthetacosphi$, $y=sinthetasinphi$ and $z=costheta$, then $sintheta=sqrt1-cos^2theta=sqrt1-z^2$ and thus $x=sqrt1-z^2cosphi$. Also, unfortunately I don't drink beer :-) But thanks anyway!
â joriki
Aug 17 at 4:22
1
@user3458909: Further to a): This is actually exactly why you'd divide by $sintheta$ if you'd look only at the angle a single vector forms with the $z$ axis: $z=costheta$ is uniformly distributed, and the Jacobian $fracmathrm dzmathrm dtheta$ is $sintheta$, so if you take the density for $theta$, it becomes flat if you divide it by $sintheta$, since you thereby transform it into the uniform density for $z$.
â joriki
Aug 17 at 4:34
1
Perfect, i think that's all that i had to understand, thank you SO MUCH. I'll now code it and eventually put up an image of the flattened map!
â user3458909
Aug 20 at 8:00
 |Â
show 27 more comments
up vote
1
down vote
accepted
Here's a new answer, based on the clarifications in the comments below.
You clarified that what you're interested in isn't really normalization, but rather a reference density that would be expected for a free molecule so that you can divide this out in order to visualize effects that cause deviations from this free-molecule density.
Let's regard the molecule as fixed and the reference axis for $theta$ and $psi$ as freely rotating; that is, let's view the angles $theta$ and $psi$ as the angles that two fixed orthogonal vectors form with a uniformly random direction. Let the fixed $x$ and $y$ axes point along the two orthogonal vectors. A uniformly random unit direction vector has independent uniform distributions of $z$ over $[-1,1]$ and of $phi$ (the angle about the $z$ axis) over $[0,2pi]$. (Here the $z$ axis is not the random reference axis, but the fixed coordinate axis orthogonal to the $x$ and $y$ axes.) The transformation from $z,phi$ to $x,y$ is
$$
x=sqrt1-z^2cosphi;,\
y=sqrt1-z^2sinphi;.
$$
Thus
begineqnarray*
fracpartial(x,y)partial(z,phi)
&=&left|matrixfracpartial xpartial z&fracpartial xpartialphi\fracpartial ypartial z&fracpartial ypartialphiright|
\
&=&left|matrixfrac zsqrt1-z^2cosphi&-sqrt1-z^2sinphi\frac zsqrt1-z^2sinphi&sqrt1-z^2cosphiright|
\
&=&
z
\
&=&
sqrt1-x^2-y^2;.
endeqnarray*
The further transform according to $x=costheta$ and $y=cospsi$ has Jacobian
$$
fracpartial(x,y)partial(theta,psi)=sinthetasinpsi;,
$$
so in all we have
$$
fracpartial(z,phi)partial(theta,psi)=fracsinthetasinpsisqrt1-cos^2theta-cos^2psi;.
$$
This is the factor you need to divide by, since the density for $z$ and $phi$ is flat (as these variables are independently uniformly distributed), and the densities are releated by
$$
f_z,phi(z,phi)mathrm dzmathrm dphi=f_theta,psi(theta,psi)mathrm dthetamathrm dpsi
$$
and thus
$$
f_theta,psi(theta,psi)=fracpartial(z,phi)partial(theta,psi)f_z,phi(z,phi)proptofracpartial(z,phi)partial(theta,psi);.
$$
Here $theta$ and $psi$ are limited to values for which the radicand in the denominator is non-negative, that is, to the diamond
$$
left|,theta-fracpi2right|+left|,psi-fracpi2right|lefracpi2;.
$$
This result fits with your image. It's restricted to the diamond; it shows roughly a $sinthetasinpsi$ behaviour along the boundary; and the divergence at the boundary (mitigated by your binning procedure) is recognizable.
1
@user3458909: Ah, I think I finally understood what you want to do :-). You really do want a flat distribution inside the rhombus for the orthogonal freely rotating molecule, not because it's actually flat but because you want to be able see the other effects stand out from a flat reference. (Part of the misunderstanding was that I thought that by "density of states" you were referring to a physical effect, but it seems you meant the geometric effect that you're trying to divide out.) (I studied physics a long time ago, by the way. :-)
â joriki
Aug 15 at 9:53
1
@user3458909: a) No; it's a nice feature of a sphere in three dimensions that it has equal surface area in slices of equal height; see e.g. here and here. More generally, in $n$ dimensions a slice of a hypersphere of height $mathrm dz$ has surface proportional to $sin^n-2thetafracmathrm dzsintheta=sin^n-3thetamathrm dz$, and it just so happens that the dependence on $theta$ vanishes for $n=3$.
â joriki
Aug 17 at 4:22
1
@user3458909: b) I think the best thing to search for here is "spherical coordinates" (e.g. at Wikipedia). If $x=sinthetacosphi$, $y=sinthetasinphi$ and $z=costheta$, then $sintheta=sqrt1-cos^2theta=sqrt1-z^2$ and thus $x=sqrt1-z^2cosphi$. Also, unfortunately I don't drink beer :-) But thanks anyway!
â joriki
Aug 17 at 4:22
1
@user3458909: Further to a): This is actually exactly why you'd divide by $sintheta$ if you'd look only at the angle a single vector forms with the $z$ axis: $z=costheta$ is uniformly distributed, and the Jacobian $fracmathrm dzmathrm dtheta$ is $sintheta$, so if you take the density for $theta$, it becomes flat if you divide it by $sintheta$, since you thereby transform it into the uniform density for $z$.
â joriki
Aug 17 at 4:34
1
Perfect, i think that's all that i had to understand, thank you SO MUCH. I'll now code it and eventually put up an image of the flattened map!
â user3458909
Aug 20 at 8:00
 |Â
show 27 more comments
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Here's a new answer, based on the clarifications in the comments below.
You clarified that what you're interested in isn't really normalization, but rather a reference density that would be expected for a free molecule so that you can divide this out in order to visualize effects that cause deviations from this free-molecule density.
Let's regard the molecule as fixed and the reference axis for $theta$ and $psi$ as freely rotating; that is, let's view the angles $theta$ and $psi$ as the angles that two fixed orthogonal vectors form with a uniformly random direction. Let the fixed $x$ and $y$ axes point along the two orthogonal vectors. A uniformly random unit direction vector has independent uniform distributions of $z$ over $[-1,1]$ and of $phi$ (the angle about the $z$ axis) over $[0,2pi]$. (Here the $z$ axis is not the random reference axis, but the fixed coordinate axis orthogonal to the $x$ and $y$ axes.) The transformation from $z,phi$ to $x,y$ is
$$
x=sqrt1-z^2cosphi;,\
y=sqrt1-z^2sinphi;.
$$
Thus
begineqnarray*
fracpartial(x,y)partial(z,phi)
&=&left|matrixfracpartial xpartial z&fracpartial xpartialphi\fracpartial ypartial z&fracpartial ypartialphiright|
\
&=&left|matrixfrac zsqrt1-z^2cosphi&-sqrt1-z^2sinphi\frac zsqrt1-z^2sinphi&sqrt1-z^2cosphiright|
\
&=&
z
\
&=&
sqrt1-x^2-y^2;.
endeqnarray*
The further transform according to $x=costheta$ and $y=cospsi$ has Jacobian
$$
fracpartial(x,y)partial(theta,psi)=sinthetasinpsi;,
$$
so in all we have
$$
fracpartial(z,phi)partial(theta,psi)=fracsinthetasinpsisqrt1-cos^2theta-cos^2psi;.
$$
This is the factor you need to divide by, since the density for $z$ and $phi$ is flat (as these variables are independently uniformly distributed), and the densities are releated by
$$
f_z,phi(z,phi)mathrm dzmathrm dphi=f_theta,psi(theta,psi)mathrm dthetamathrm dpsi
$$
and thus
$$
f_theta,psi(theta,psi)=fracpartial(z,phi)partial(theta,psi)f_z,phi(z,phi)proptofracpartial(z,phi)partial(theta,psi);.
$$
Here $theta$ and $psi$ are limited to values for which the radicand in the denominator is non-negative, that is, to the diamond
$$
left|,theta-fracpi2right|+left|,psi-fracpi2right|lefracpi2;.
$$
This result fits with your image. It's restricted to the diamond; it shows roughly a $sinthetasinpsi$ behaviour along the boundary; and the divergence at the boundary (mitigated by your binning procedure) is recognizable.
Here's a new answer, based on the clarifications in the comments below.
You clarified that what you're interested in isn't really normalization, but rather a reference density that would be expected for a free molecule so that you can divide this out in order to visualize effects that cause deviations from this free-molecule density.
Let's regard the molecule as fixed and the reference axis for $theta$ and $psi$ as freely rotating; that is, let's view the angles $theta$ and $psi$ as the angles that two fixed orthogonal vectors form with a uniformly random direction. Let the fixed $x$ and $y$ axes point along the two orthogonal vectors. A uniformly random unit direction vector has independent uniform distributions of $z$ over $[-1,1]$ and of $phi$ (the angle about the $z$ axis) over $[0,2pi]$. (Here the $z$ axis is not the random reference axis, but the fixed coordinate axis orthogonal to the $x$ and $y$ axes.) The transformation from $z,phi$ to $x,y$ is
$$
x=sqrt1-z^2cosphi;,\
y=sqrt1-z^2sinphi;.
$$
Thus
begineqnarray*
fracpartial(x,y)partial(z,phi)
&=&left|matrixfracpartial xpartial z&fracpartial xpartialphi\fracpartial ypartial z&fracpartial ypartialphiright|
\
&=&left|matrixfrac zsqrt1-z^2cosphi&-sqrt1-z^2sinphi\frac zsqrt1-z^2sinphi&sqrt1-z^2cosphiright|
\
&=&
z
\
&=&
sqrt1-x^2-y^2;.
endeqnarray*
The further transform according to $x=costheta$ and $y=cospsi$ has Jacobian
$$
fracpartial(x,y)partial(theta,psi)=sinthetasinpsi;,
$$
so in all we have
$$
fracpartial(z,phi)partial(theta,psi)=fracsinthetasinpsisqrt1-cos^2theta-cos^2psi;.
$$
This is the factor you need to divide by, since the density for $z$ and $phi$ is flat (as these variables are independently uniformly distributed), and the densities are releated by
$$
f_z,phi(z,phi)mathrm dzmathrm dphi=f_theta,psi(theta,psi)mathrm dthetamathrm dpsi
$$
and thus
$$
f_theta,psi(theta,psi)=fracpartial(z,phi)partial(theta,psi)f_z,phi(z,phi)proptofracpartial(z,phi)partial(theta,psi);.
$$
Here $theta$ and $psi$ are limited to values for which the radicand in the denominator is non-negative, that is, to the diamond
$$
left|,theta-fracpi2right|+left|,psi-fracpi2right|lefracpi2;.
$$
This result fits with your image. It's restricted to the diamond; it shows roughly a $sinthetasinpsi$ behaviour along the boundary; and the divergence at the boundary (mitigated by your binning procedure) is recognizable.
edited Aug 20 at 8:21
answered Aug 15 at 7:10
joriki
165k10180329
165k10180329
1
@user3458909: Ah, I think I finally understood what you want to do :-). You really do want a flat distribution inside the rhombus for the orthogonal freely rotating molecule, not because it's actually flat but because you want to be able see the other effects stand out from a flat reference. (Part of the misunderstanding was that I thought that by "density of states" you were referring to a physical effect, but it seems you meant the geometric effect that you're trying to divide out.) (I studied physics a long time ago, by the way. :-)
â joriki
Aug 15 at 9:53
1
@user3458909: a) No; it's a nice feature of a sphere in three dimensions that it has equal surface area in slices of equal height; see e.g. here and here. More generally, in $n$ dimensions a slice of a hypersphere of height $mathrm dz$ has surface proportional to $sin^n-2thetafracmathrm dzsintheta=sin^n-3thetamathrm dz$, and it just so happens that the dependence on $theta$ vanishes for $n=3$.
â joriki
Aug 17 at 4:22
1
@user3458909: b) I think the best thing to search for here is "spherical coordinates" (e.g. at Wikipedia). If $x=sinthetacosphi$, $y=sinthetasinphi$ and $z=costheta$, then $sintheta=sqrt1-cos^2theta=sqrt1-z^2$ and thus $x=sqrt1-z^2cosphi$. Also, unfortunately I don't drink beer :-) But thanks anyway!
â joriki
Aug 17 at 4:22
1
@user3458909: Further to a): This is actually exactly why you'd divide by $sintheta$ if you'd look only at the angle a single vector forms with the $z$ axis: $z=costheta$ is uniformly distributed, and the Jacobian $fracmathrm dzmathrm dtheta$ is $sintheta$, so if you take the density for $theta$, it becomes flat if you divide it by $sintheta$, since you thereby transform it into the uniform density for $z$.
â joriki
Aug 17 at 4:34
1
Perfect, i think that's all that i had to understand, thank you SO MUCH. I'll now code it and eventually put up an image of the flattened map!
â user3458909
Aug 20 at 8:00
 |Â
show 27 more comments
1
@user3458909: Ah, I think I finally understood what you want to do :-). You really do want a flat distribution inside the rhombus for the orthogonal freely rotating molecule, not because it's actually flat but because you want to be able see the other effects stand out from a flat reference. (Part of the misunderstanding was that I thought that by "density of states" you were referring to a physical effect, but it seems you meant the geometric effect that you're trying to divide out.) (I studied physics a long time ago, by the way. :-)
â joriki
Aug 15 at 9:53
1
@user3458909: a) No; it's a nice feature of a sphere in three dimensions that it has equal surface area in slices of equal height; see e.g. here and here. More generally, in $n$ dimensions a slice of a hypersphere of height $mathrm dz$ has surface proportional to $sin^n-2thetafracmathrm dzsintheta=sin^n-3thetamathrm dz$, and it just so happens that the dependence on $theta$ vanishes for $n=3$.
â joriki
Aug 17 at 4:22
1
@user3458909: b) I think the best thing to search for here is "spherical coordinates" (e.g. at Wikipedia). If $x=sinthetacosphi$, $y=sinthetasinphi$ and $z=costheta$, then $sintheta=sqrt1-cos^2theta=sqrt1-z^2$ and thus $x=sqrt1-z^2cosphi$. Also, unfortunately I don't drink beer :-) But thanks anyway!
â joriki
Aug 17 at 4:22
1
@user3458909: Further to a): This is actually exactly why you'd divide by $sintheta$ if you'd look only at the angle a single vector forms with the $z$ axis: $z=costheta$ is uniformly distributed, and the Jacobian $fracmathrm dzmathrm dtheta$ is $sintheta$, so if you take the density for $theta$, it becomes flat if you divide it by $sintheta$, since you thereby transform it into the uniform density for $z$.
â joriki
Aug 17 at 4:34
1
Perfect, i think that's all that i had to understand, thank you SO MUCH. I'll now code it and eventually put up an image of the flattened map!
â user3458909
Aug 20 at 8:00
1
1
@user3458909: Ah, I think I finally understood what you want to do :-). You really do want a flat distribution inside the rhombus for the orthogonal freely rotating molecule, not because it's actually flat but because you want to be able see the other effects stand out from a flat reference. (Part of the misunderstanding was that I thought that by "density of states" you were referring to a physical effect, but it seems you meant the geometric effect that you're trying to divide out.) (I studied physics a long time ago, by the way. :-)
â joriki
Aug 15 at 9:53
@user3458909: Ah, I think I finally understood what you want to do :-). You really do want a flat distribution inside the rhombus for the orthogonal freely rotating molecule, not because it's actually flat but because you want to be able see the other effects stand out from a flat reference. (Part of the misunderstanding was that I thought that by "density of states" you were referring to a physical effect, but it seems you meant the geometric effect that you're trying to divide out.) (I studied physics a long time ago, by the way. :-)
â joriki
Aug 15 at 9:53
1
1
@user3458909: a) No; it's a nice feature of a sphere in three dimensions that it has equal surface area in slices of equal height; see e.g. here and here. More generally, in $n$ dimensions a slice of a hypersphere of height $mathrm dz$ has surface proportional to $sin^n-2thetafracmathrm dzsintheta=sin^n-3thetamathrm dz$, and it just so happens that the dependence on $theta$ vanishes for $n=3$.
â joriki
Aug 17 at 4:22
@user3458909: a) No; it's a nice feature of a sphere in three dimensions that it has equal surface area in slices of equal height; see e.g. here and here. More generally, in $n$ dimensions a slice of a hypersphere of height $mathrm dz$ has surface proportional to $sin^n-2thetafracmathrm dzsintheta=sin^n-3thetamathrm dz$, and it just so happens that the dependence on $theta$ vanishes for $n=3$.
â joriki
Aug 17 at 4:22
1
1
@user3458909: b) I think the best thing to search for here is "spherical coordinates" (e.g. at Wikipedia). If $x=sinthetacosphi$, $y=sinthetasinphi$ and $z=costheta$, then $sintheta=sqrt1-cos^2theta=sqrt1-z^2$ and thus $x=sqrt1-z^2cosphi$. Also, unfortunately I don't drink beer :-) But thanks anyway!
â joriki
Aug 17 at 4:22
@user3458909: b) I think the best thing to search for here is "spherical coordinates" (e.g. at Wikipedia). If $x=sinthetacosphi$, $y=sinthetasinphi$ and $z=costheta$, then $sintheta=sqrt1-cos^2theta=sqrt1-z^2$ and thus $x=sqrt1-z^2cosphi$. Also, unfortunately I don't drink beer :-) But thanks anyway!
â joriki
Aug 17 at 4:22
1
1
@user3458909: Further to a): This is actually exactly why you'd divide by $sintheta$ if you'd look only at the angle a single vector forms with the $z$ axis: $z=costheta$ is uniformly distributed, and the Jacobian $fracmathrm dzmathrm dtheta$ is $sintheta$, so if you take the density for $theta$, it becomes flat if you divide it by $sintheta$, since you thereby transform it into the uniform density for $z$.
â joriki
Aug 17 at 4:34
@user3458909: Further to a): This is actually exactly why you'd divide by $sintheta$ if you'd look only at the angle a single vector forms with the $z$ axis: $z=costheta$ is uniformly distributed, and the Jacobian $fracmathrm dzmathrm dtheta$ is $sintheta$, so if you take the density for $theta$, it becomes flat if you divide it by $sintheta$, since you thereby transform it into the uniform density for $z$.
â joriki
Aug 17 at 4:34
1
1
Perfect, i think that's all that i had to understand, thank you SO MUCH. I'll now code it and eventually put up an image of the flattened map!
â user3458909
Aug 20 at 8:00
Perfect, i think that's all that i had to understand, thank you SO MUCH. I'll now code it and eventually put up an image of the flattened map!
â user3458909
Aug 20 at 8:00
 |Â
show 27 more comments
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2883254%2fnormalization-of-an-angle-distribution-in-cartesian-coordinates%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password