2
$\begingroup$

How to make random positions in Equatorial coordinate system?

If I divide Dec between -90 and 90 evenly, the space distribution is not random.

$\endgroup$

1 Answer 1

6
$\begingroup$

Well, your problem is that you have a sphere. To compensate for the polar declination skew, you just calculate $$\sin^{-1}(\mathtt{rand})$$ Where $\mathtt{rand}$ is a number in an evenly divided -1 to 1 range. Alternatively, you can use another trigonometric function based on what you have available, but you get the idea.

RA can obviously be divided evenly.

$\endgroup$
4
  • $\begingroup$ beautiful math :) $\endgroup$
    – Fattie
    Commented Jun 26, 2016 at 1:07
  • $\begingroup$ @hohmannfan You mean I need to make random Decs, then change them to sin-1(dec)? or sin-1(dec) is a weighing coefficient which correlates with area? $\endgroup$ Commented Jun 29, 2016 at 9:54
  • $\begingroup$ @questionhang You need to make random numbers evenly in the -1 to 1 area, and pipe them through the sin-1 formula. The output can be used together with random RA's to get random coordinates on a sphere, without any skew. $\endgroup$ Commented Jun 29, 2016 at 10:52
  • $\begingroup$ @@hohmannfan I do not understand my question now. What is a random distribution on a 2-D sphere? $\endgroup$ Commented Jul 1, 2016 at 16:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .