The bivariate normal simulator was created in javascript from ideas specified by David C. Howell on his page Generating Data with a Specified Correlation. Generating data pairs (X, Y) from a bivariate normal distribution with a specific correlation (r), X~N(m1,s1), and Y~N(m2,s2) is actually quite easy. These are the steps (modifed from what Howell described) ....
*Now, the variables W and Z1 have a correlation, r, that, on average, will equal r. What we want to do now is rescale each variable so that it has a specified mean, m, and standard deviation, s. The Z1 will be approximately, but not exactly (because it is essentially a sample), N(0,1) and W will be approximately N(0,(a2+1+2ar)0.5). I show how to get the standard deviation of W in the appendix below.
Rescaling to a specified m and s is easy if the variables are N(0,1). So let's standardize each ...
Standardize W* (i.e., substract the mean of W and divide by the SD of W) Standardize Z1* (i.e., substract the mean of Z1 and divide by the SD of Z1)
*Now both W* and Z1* are N(0,1) and still have a correlation of r (the correlation is not affected by linear transformations of the variables). The following steps can be used to maintain the correlation between the two variables, but allow for the specific means and standard deviations.
Linearly transform Z1*, using the specified mean, m1, and standard deviation, s1, to a new variable X; i.e., X = s1*Z1 + m1. Linearly transform W*, using the specified mean, m2, and standard deviation, s2, to a new variable Y; i.e., Y = s2*W + m2.
Var(W) = Var(a*Z1+Z2) = Var(aZ1)+Var(Z2)+2Cov(aZ1,Z2) =
(a^2)Var(Z1)+Var(Z2)+2aCov(Z1,Z2)
where Var(Z1) = Var(Z2) = 1 and Cov(Z1,Z2) = r
Thus, Var(W) = (a^2) + 1 + 2ar.
The SD of W is obviously the square root of Var(W)