I've seen this cool function, which generates a given distribution of points on the unit sphere, known as Dimroth-Watson distribution:
(* special case; κ = 0 is the uniform distribution *) dimrothWatsonRandom[μ_?VectorQ, κ_ /; κ == 0] := Normalize[RandomVariate[NormalDistribution[], 3]] dimrothWatsonRandom[μ_?VectorQ, κ_ /; NumericQ[κ] && Positive[κ]] := Module[{c, u, v, w}, c = Exp[-κ/2] Csch[κ/2]/2; While[ {u, v} = RandomReal[1, 2]; w = Log[1 + u/c]/κ; v > Exp[κ w (w - 1)]]; RotationTransform[{{0, 0, 1}, Normalize[μ]}][Append[ Sqrt[1 - w^2] Normalize[RandomVariate[NormalDistribution[], 2]], RandomChoice[{-1, 1}] w]]] dimrothWatsonRandom[μ_?VectorQ, κ_ /; NumericQ[κ] && Negative[κ]] := Module[{c, d, u, v, w}, c = Sqrt[-κ]; d = ArcTan[c]; While[ {u, v} = RandomReal[1, 2]; w = Tan[d u]/c; v > (1 - κ w^2) Exp[κ w^2]]; RotationTransform[{{0, 0, 1}, Normalize[μ]}][Append[ Sqrt[1 - w^2] Normalize[RandomVariate[NormalDistribution[], 2]], RandomChoice[{-1, 1}] w]]] Let us consider a specific case, with $k>0$, so that the points become 'bipolar'. Also, let's just add a Sphere[] to visualize the points, the center, and the direction of the vector:
k = 4; dirVector = {1, 0, 0}; center = {0, 0, 0}; nPoints = 1000; myPoints = Table[dimrothWatsonRandom[dirVector, k], {nPoints}]; (*Visualize it*) Graphics3D[{Opacity[0.125], Sphere[], Opacity[0.5], Red, PointSize[0.02], Point[center], Opacity[0.25], Blue, PointSize[0.01], Point[myPoints], Opacity[0.5], Red, PointSize[0.02], Point[dirVector]}] Question is: can we map the points from the surface of this sphere onto the surface of an Ellipsoid[]?
So far, my attempt is to create a small ellipsoid (so it's inside the unit sphere), then find the nearest points to its surface:
reg = Ellipsoid[{0, 0, 0}, {0.5, 0.25, 0.25}]; npl = Table[RegionNearest[reg, p], {p, myPoints}]; Legended[Graphics3D[{reg, {Thin, Gray, Line[Transpose[{myPoints, npl}]]}, {Red, Point[myPoints]}, {PointSize[Medium], Blue, Point[npl]}}, Lighting -> "Neutral", Boxed -> False], PointLegend[{Red, Blue}, {"start", "nearest"}]] I'm hoping there's a more elegant way to do this.
Edit 1: In the example I show the circle and ellipsoid have the same orientation because of the dirVector I used. Suppose that the ellipsoid has some arbitrary orientation. Thus, the transfer of points should take the direction of dirVector and align it with the major axis of the ellipsoid. As flinty pointed out in the comments, this would require some rotation/translation transformation, which I don't know how'd be applied, so it would be great if somebody comes up with a solution for this too.
Edit 2: Could something like this be done here, preserving the relative positions of the points?



Manipulate[]the eccentricity to a sphere? $\endgroup$Graphics3D[{reg, Blue, Point[reg[[2]]*# & /@ myPoints], Green, Point[npl] }]- but that will change the density of points - note the discrepancy between blue and green points. For the rotation this is really easy, just use aRotationTransform[{u,{1,0,0}}]that moves the vectoruto{1,0,0}and apply to all points on the sphere, do stuff with the axis aligned ellipse, then rotate back withRotationTransform[{{1,0,0},u}]$\endgroup$