We solve variationally certain equations of stellar dynamics of the form - Sigma(i)partial derivative(ii)u(x) = vertical bar u vertical bar(p-2) u(x)/dist(x,A)(s) in a domain Omega of R(n), where A is a proper linear subspace of R(n). Existence problems are related to the question of attainability of the best constant in the following inequality due to Maz'ya (1985): 0 < mu(s,) (P)(Omega) = inf {integral(Omega)vertical bar del u vertical bar(2) dx vertical bar u is an element of H(1,0)(2)(Omega) and integral vertical bar u(x)vertical bar(2)*(s)/vertical bar pi(x)vertical bar(s) dx =1}, where 0 < s < 2, 2*(s) = 2(n-s)/n-2 and where pi is the orthogonal projection on a linear space P, where dim(R)P >= 2 (see also Badiale-Tarantello (2002)). We investigate this question and how it depends on tile relative position of the subspace P(perpendicular to), the orthogonal of P, with respect to the domain Omega, as well as on the curvature of the boundary partial derivative Omega at its points of intersection with P(perpendicular to).