pbrod / nvector

Nvector is a suite of tools written in Python to solve geographical position calculations.
Other
57 stars 7 forks source link

Find GeoPosition from GeoPosition and cartesian vector #14

Open munich-dev opened 3 years ago

munich-dev commented 3 years ago

Hi,

I'm using this code for calculating the cartesian vector from "origin" to "target": ` wgs84 = nv.FrameE(name='WGS84') origin = wgs84.GeoPoint(latitude=latitudeOrigin, longitude=longitudeOrigin, z=altitudeOrigin, degrees=False) target = wgs84.GeoPoint(latitude=latitudeTarget, longitude=longitudeTarget, z=altitudeTarget, degrees=False)

    p_AB_N = origin.delta_to(target)
    x, y, z = p_AB_N.pvector.ravel()

`

Now, how can I reverse this operation? I have an origin and a cartesian vector and like to find the vector position as a GeoPosition (in my example "target").

In Pseudo-Code: target = origin.to_geo_position(np.r_[x,y,z].reshape((-1, 1)))

Thank you, Manfred

pbrod commented 3 years ago

See example 2 or the GeoPoint.displace method.