# How to move two points of geolocation with keeping distance between them

I have two points of location with certain longitude and latitude. My goal to move them so that longitude and latitude will change but distance remained as before.

This image illustrates what I need to achieve

• so basically you want a circle as though laid out on the surface of a sphere. – user451844 Sep 16 '17 at 19:14
• I want to move two geolocation points for example in parallel with Greenwich meridian and save distance between them. The latitude and longitude of new location positions should stay on earth surface. – Viktor Ivanov Sep 16 '17 at 19:36

The "proper" way to do this is with Vincenty's direct algorithm. That takes the exact ellipsoid flatness parameter into account. There are simpler methods if you're willing to accept a spherical approximation.

I've got what I needed in my circumstances. I just convert the location to Descartes coordinate system, move points using linear algebra matrix rotation to a particular direction in Vector 3. \begin{alignedat}{1}R_{x}(\theta )&={\begin{bmatrix}1&0&0\\0&\cos \theta &-\sin \theta \\[3pt]0&\sin \theta &\cos \theta \\[3pt]\end{bmatrix}}\\[6pt]R_{y}(\theta )&={\begin{bmatrix}\cos \theta &0&\sin \theta \\[3pt]0&1&0\\[3pt]-\sin \theta &0&\cos \theta \\\end{bmatrix}}\\[6pt]R_{z}(\theta )&={\begin{bmatrix}\cos \theta &-\sin \theta &0\\[3pt]\sin \theta &\cos \theta &0\\[3pt]0&0&1\\\end{bmatrix}}\end{alignedat}