Hi I am looking at the contours of the following function f, which trace out an ellipse: [tex] f(x, y, z) = \exp(-x^2a)\exp(-y^2b) [/tex] Here [itex]a\neq b[/itex] are both positive, real constants. The axis of these ellipses is along [itex]z[/itex]. Now, I am wondering how to generalize the function f such that the symmetry axis of these elliptical contours lies along an arbitrary vector defined by some line that goes through the point p=(x0, y0, z0) and has directional vector r (in usual spherical coordinates) [tex] r = (\sin \theta, \cos \phi, \sin \theta\sin\phi, \cos \theta) [/tex] If [itex]a=b=1[/itex] the task would be easy: In this case we can write [itex]d^2 = x^2 + y^2[/itex], and generalize this such that it gives the distance between the point/coordinate (x,y,z) and the above line (p, r). But when [itex]a\neq b[/itex] I can't write [itex]d^2[/itex] like that. What can I do in this general case? Note that this question is a generalization of this thread, where the case [itex]a=b=1[/itex] was treated. Thanks in advance for hints/help.