infinite angles,therefore my plan is to launch rays from the
trasmitter in all directions spaced eg. x degrees or something. This
is the earlier logic I have used for a C program -
consider the source to be centre of the unit sphere.
0<=theta<=180(zenith)
0<=phi<=360 (azimuth)
for (theta = 0; theta <= 180; theta += incr)
{
double sint = sin(pi / 180 * theta);
double cost = cos(pi / 180 * theta);
for (phi = 0; phi < 360; phi += incr)
{
P.x = sint * cos(pi / 180 * phi);
P.y = sint * sin(pi / 180 * phi);
P.z = cost;
}
}
P is basically a point on sphere which I calculated using spherical coordinates. Now when I know P and I know the source i.e. center of sphere, I can calculate the direction of ray. Doing so through the loop gives me direction of the rays. I can get finer rays by adjusting incr.However, I realized a little flaw in my program. At theta = 0 and 180 there is only one ray each so there is no need to loop into phi for that. Also, if I go by this scheme, I get thick bundle of rays near to the poles as compared to the equator. So I changed my program as follows -
treat theta =0 and 180 as special case.
then,
for(theta = incr; theta < 180; theta += incr)
double sint = sin(pi / 180 * theta);
double cost = cos(pi / 180 * theta);
{
for (phi = 0; phi < 360; phi += incr/sin(theta))
{
P.x = sint * cos(pi / 180 * phi);
P.y = sint * sin(pi / 180 * phi);
P.z = cost;
}
}
I divide incr by sin(theta). With this the spacing between rays is more at the poles so they tend to get bundled up. Also, I calculated this scaling factor by dividing circumference of the horizontal disc at equator which is 2 PI R with circumference of the horizontal disc at a random angle theta i.e. 2 PI R sin(theta).
I would like to know if my new approach is correct or not.












