Here's the problem for what it is worth.
Bear with me and I'll get to the Trigonometry part.
The dipole moment is defined as
a \hat{i} + (-q)(-a) \hat{i} + (2q)L \hat{j} = 2qL \hat{j})
(The

is the displacement vector from the origin to the point where the charge q sits.)
Now pick a point

in three space. Specifically
The dipole term of the potential is calculated by
)
where
)
is the direction cosine of the angle between

and

. (ie. the cosine of the angle between

and the y axis, if we make the triangle form by putting the tails of

and

at the origin.)
The question then is how to write
)
in terms of Cartesian coordinates? I could use the Law of Cosines to find the angle if I had the length of the line between the heads of

and

. I could use the Law of Sines, but I don't have any of the angles in the triangle.
Any thoughts? Thanks!
-Dan