J

A(x1,y1,z1), B(x2,y2,z2), and dA(dx, dy, dz)A and B calculate the transfer of spherical coordinates to the decart!old distance R1=Koren (kvarat(x1-x2)+Qvadrate(y1-y2)+Qvadrate(z1-z2))new distance R2=Koren(x1-x2+dx)+Qvadrate(y1-y2+dy)+Quadrate(z1-z2+dz)Distance difference dR = R2-R1;Read the transfer from the spherical coordinates to the decarto. https://ru.wikipedia.org/wiki/%D0%A1%D1%84%D0%B5%D1%80%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B0%D1%8F_%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%B0_%D0%BA%D0%BE%D0%BE%D1%80%D0%B4%D0%B8%D0%BD%D0%B0%D1%82 And you'll be happyThere's nothing else.UPD:There is a vector A( majoritya,φa), Véctor B(damb,φb), and vector A2(voa+d majority,φa+dφ)They're in the decart system A(Xa,Ya,Za) B(Xb,Yb,Zb),Where Xi=sin( majorityi)*cos(φi), Yi=sin(dami)*sin(φi), Zi=cos(dami)We'll find a corner between them αab=ArcCos(ab'/(a'b')where ab'=XaXb+YaYb+Za*Zb, a'=Koren(Xa^2+Ya2+Za^2), b'=Koren(Xb^2+Yb^2+Zb^2)Lab=αab*Ri.e. approximately:public double GetSphereSectorLen(double ϴ1,double φ1,double ϴ2,double φ2, double R)
{
double X1=Math.Sin(ϴ1)*Math.Cos(φ1);
double Y1=Math.Sin(ϴ1)*Math.Sin(φ1);
double Z1=Math.Cos(ϴ1);
double X2=Math.Sin(ϴ2)*Math.Cos(φ2);
double Y2=Math.Sin(ϴ2)*Math.Sin(φ2);
double Z2=Math.Cos(ϴ2);
double ab_=X1*X2+Y1*Y2+Z1*Z2;
double a_=Math.Sqrt(Math.Pow(X1,2)+Math.Pow(Y1,2)+Math.Pow(Z1,2));
double b_=Math.Sqrt(Math.Pow(X2,2)+Math.Pow(Y2,2)+Math.Pow(Z2,2));
double αab=Math.Acos(ab_/(a_*b_));
return αab*R;
}
double LAB=GetSphereSectorLen(ϴa,φa,ϴb,φb);
double LA2B=GetSphereSectorLen(ϴa+dϴ,φa+dφ,ϴb,φb);
double dL = LAB-LA2B;