Idealized trajectory from sloped surface

I am a GIS programmer implementing a visualization.

I am modeling the idealized trajectory of a particle ejected from a volcanic vent using:

$$\text{distance} = \frac{(v^2 \times sin(2\theta))}{g}.$$

Where $g = 1.62\:\mathrm{m/s^2}$, $v$ is velocity, and $\theta$ is ejection angle. $g$ is the lunar gravity constant I was supplied.

How can I incorporate the slope of the underlying surface assuming a single point of ejection? 

EDIT: My current workflow is to compute total travel distance, extract a topographic profile along the total theoretical travel distance and then check the height of the projectile to the height of the actual surface at 100m intervals. In this way I can compute the landing site for the projectile.

EDIT 2: I updated the question with the correct formula. Apologies for the incorrect transposition. My implementation now assumes a completely flat surface. What happens when the ejection surface is sloped either uphill or downhill?

-
If you want to know the trajectory, what you are interested should be x(t) and y(t) instead of distance. Also what is the meaning of the last questions? n points is no different from a single point. Can you clarify that – hwlau Jan 16 '13 at 18:56
One more things, your equation looks wrong and g, how do you get this? – hwlau Jan 16 '13 at 18:58
@Jay Laura Firstly, your formula is still wrong. $\frac{v^2\sin2\theta}{g}\neq\frac{2v^2\sin\theta}{g}$ Secondly, I've updated my answer with a formula that might help you. – jkej Jan 17 '13 at 9:28

An idealized projectile launched from ground with speed $v$ at angle $\theta$ measured from zenith will reach ground at time:

$$t=\frac{2v\sin\theta}{g}$$

assuming the ground is level. The horizontal distance it will have traveled in that time is:

$$d=\frac{2v^2\sin\theta\cos\theta}{g}=\frac{v^2\sin 2\theta}{g}$$

For small $\theta$ you could approximate this with:

$$d\approx\frac{2v^2\theta}{g}$$

but I guess you need a formula that works also for larger $\theta$.

If the ground is sloped with a constant angle $\alpha$ (positive angles for uphill slopes) from the ejection point to where it hits the ground, you can use the following formula:

$$d=\frac{2v^2\sin\theta(\cos\theta-\sin\theta\tan\alpha)}{g}$$

Do you want me to show you how I derived the formula?

-
I updated my question to hopefully include more information. Apologies for an incomplete question. Quite out of my element! – Jay Laura Jan 17 '13 at 2:31
Thanks. I would be interested in knowing how the derivation works. Again, not a physicist, but interested. – Jay Laura Jan 17 '13 at 13:23