# 3D Vectors wrap on the Sphere

How I can wrap the 3D vectors around the sphere surface like this one. My angles are

θ[x_, y_] := π (1 - Exp[-((x^2 + y^2)/R^2)]);
ϕ[x_, y_ ] := ArcTan[x, y] - Pi/2;


With

{Cos[ϕ[x, y ]] Sin[θ[x, y]], Sin[ϕ[x, y ]] Sin[θ[x, y]], Cos[θ[x, y]]}.

• What about a 3D vector field wherein that is the outer most orientation of the vectors then do a 3D sphere insert via Epilog or something similar? – CA Trevillian Feb 20 at 3:56

## Create a mesh

mesh[θ_,n_]:=Table[{Cos[ϕ] Sin[θ],Sin[ϕ] Sin[θ],Cos[θ]},{ϕ,π/n,2 π,(2 π)/n}];
p={{0,1},{π/6,6},{2π/6,9},{3π/6,12},{4π/6,9},{5π/6,6},{π,1}};
points=Join[Flatten[mesh[#[],#[]]&/@p,1]];

• There are 7 θ-slices: {0, π/6, 2π/6, 3π/6, 4π/6, 5π/6, π}. The number of ϕ-points in each slice is different for esthetic reasons.

• p contains data of the form {θ,n}: how many ϕ-points is needed for each θ value.

• points is a combined list of points where the vector field is plotted.

## Define a field

field[x_,y_,z_]:=Module[{θ,ϕ},ϕ=If[x^2+y^2>0,ArcTan[x,y],0];θ=ArcTan[z,Sqrt[x^2+y^2]];
{-Sin[ϕ]Sin[θ],Cos[ϕ]Sin[θ],Cos[θ]}]


We will be plotting a skyrmion with winding number 1, as requested in the OP. Other customizations are possible. For instance one can consider higher-order skyrmions, or skyrmions with opposite topological charge---antiskyrmions.

## Combine vector plot and a sphere

g1=VectorPlot3D[field[x,y,z],{x,-1,1},{y,-1,1},{z,-1,1},VectorPoints->points,VectorStyle->"Arrow3D",VectorColorFunction->Function[{x,y,z,vx,vy,vz,n},ColorData["Rainbow"][z]],Axes->False];
g2=Graphics3D[Sphere[{0,0,0},0.9]];
Show[{g1,g2},Boxed->False,ImageSize->Large] SliceVectorPlot3D[{y, -x, z}, "CenterSphere", {x, -2, 2}, {y, -2, 2}, {z, -2, 2}] 