span8

span4

span8

span4

- Home /
- *FME Desktop /

Hello.

This might be a strange question since it does not take into account the Earth. Also, I am quite new to this topic but I did research. I found a lot of things but I never got the result I wanted from various calculators and doing it manually is hard since I am not that familliar with this math.

I was wondering, is there some way to calculate XYZ -> degrees for other bodies with different radius?

For example, this is one of solved:

Planet Radius: 2094km, Earth Masses: 0.0541, X: -1786579.7, Y: 519690.56, Z: -959322.31

This equals: Latitude: 9.2921 and Longitude: -153.9814. I figured that Y and Z are Lat\Long.

I have no idea how to get this result. Ive tried various calculators like: https://beta.ngs.noaa.gov/gtkweb/ but I just cannot get the correct numbers.

If anyone can offer any insight into this issue I would be very grateful.

Thank you.

Comment

Hello! @DaveAtSafe

Thanks for your reply!

I am on a verge of giving up because a lot of time has passed and still no real headway. Its for bonus points but I think its just too hard.

I have read that article and tried to make a C program but it failed. I usually try to exhaust all options I can find before asking. Learned a lot that way but still no closer in solving this...

Also I believe coordinates have Haversine component.

This is a software at university which is closed source. Software is used to do a lot of space calculations for Solar system but it has some addons for others. It is basically a simulator for other worlds and small bodies. Some are real (our system) and most are semi (what is known) and many are not real for practice. Navigation (1st person "hovering") is done by using this format. We are tasked to try and make several waypoints by reading XYZ and then convert them to decimal for easier navigation since every other body will be different and reading XYZ is not really good.

There are several coordinates like this one on the same body as well as few others for reference (solved) to help with the possible solutions for this and eventually some other body with different radius.

Here is another one: Radius: 2503km, EMasses: 0.0503

X: -2405525.88 Y: 490527.71 Z: 483042.96 == Latitude(Y): 11.2058, Longitude(Z): 168.5456

Also I must point out that I saw in UI something that is called "RelativePosition". Then values are (from above): X: -240.5525, Y: 490.527, Z: 483.042

Could it have something with radians? This is a snippet of small program I wrote for known coordinates for calculating area size on particular body. It yields precise results.

#define ONEDEGREEINRADIANS 0.0174532925

double degToRad(double degrees);

int main() {

double interval, radius, latitude, instance;

// bunch asking for coords and some math stuff

interval = 360 / ((cos(degToRad(latitude)) * (radius * 2 * PI)) / instance);

}

double degToRad(double degrees)

{ return ONEDEGREEINRADIANS * degrees; }

Thanks.

Hi, @robertk

The second example fits the formula much better. The results will be in radians, which must converted to degrees. I just multiply by 180/pi.

The Haversine formula will give you the distance between two lat/lon locations, but I don't think that helps us here.

Are the XYZ values centered on the planet, or are they universal for the entire system?

The second example fits the formula much better. The results will be in radians, which must converted to degrees. I just multiply by 180/pi.

The Haversine formula will give you the distance between two lat/lon locations, but I don't think that helps us here.

Are the XYZ values centered on the planet, or are they universal for the entire system?

Hi
@DaveAtSafe

XYZ values are centered on the single body. If you go to another you will get new ones. I am presumming it is because of different radiuses. That is why I think Radius (maybe EarthMasses) is key to unlocking this.

I am just not sure what is the "key" here...

XYZ values are centered on the single body. If you go to another you will get new ones. I am presumming it is because of different radiuses. That is why I think Radius (maybe EarthMasses) is key to unlocking this.

I am just not sure what is the "key" here...

@DaveAtSafe

You say that this fits the formula. Did you manage to get the correct (or at least near...) Lat\Long from the example(s)?

You say that this fits the formula. Did you manage to get the correct (or at least near...) Lat\Long from the example(s)?

@robertk,

Yes, I got a latitude of 11.127 and a longitude of 168.474, from:

x = -2405525.88

y = 490527.71

z = 483042.96

r = 2503000

Yes, I got a latitude of 11.127 and a longitude of 168.474, from:

latitude = @Evaluate(@asin(@Value(z)/@Value(r))*(180/@pi()))where:

longitude = @Evaluate(@atan2(@Value(y),@Value(x))*(180/@pi()))

x = -2405525.88

y = 490527.71

z = 483042.96

r = 2503000

Could you recommend any based on my criteria? tho it can be close. Thanks

But I'm not a planetary scientist :)

The bigger issue here is that in order to calculate that XYZ you'll also need to know what projection/coordinate system is used.

I know Global Mapper comes with a number of ellipsoids for celestial bodies (moon, all major planets, a few dwarf planets and moons). If I understand this correctly that's all you need really.

You could hack your own of course and import them into FME.

I just downloaded the evaluation version and it is quite robust. But when I tried to download data I cannot see anything except places on Earth. Unless I am missing something in the normal UI.

I don't think it comes with extraterrestrial data, but you could try NASA.

Hi @robertk,

According to Stack Overflow (https://stackoverflow.com/questions/1185408/converting-from-longitude-latitude-to-cartesian-coordinates), the formula for calculating the spherical lat, long from what appears to be geocentric coordinates would be:

latitude = asin(Z / Radius)

longitude = atan2(Y, X)

However this formula is dependent on these condition:

- the x-axis goes through long,lat (0,0), so longitude 0 meets the equator;
- the y-axis goes through (0,90);
- and the z-axis goes through the poles.

This formula gives us latitude -27.26644670517016, longitude 2.858518396400994, which is quite different from your target lat/long, so it appears that those coordinates are not geocentric.

Are you able to provide any information on the source of the coordinates?

Spatial Filter: Rejecting candidates where filter is polygon, candidate is raster 4 Answers

DGN files and its coordinate system reference 1 Answer

Translation very slow if Coordinate system is added to writer parameters 1 Answer

Ideas on Performance for calculation of Eastings/Northing for daily bulk update 3 Answers

© 2019 Safe Software Inc | Legal

- Anonymous
- Sign in
- Create
- New Question
- New Article
- New Idea
- Spaces
- 3D (and BIM)
- Attribute Handling
- Automations (FME Server)
- CAD
- Cloud
- Coordinate Systems
- Custom Transformers
- Database
- Dynamic Workspaces
- FME Cloud API
- FME Cloud Administration
- FME Cloud Getting Started
- FME Desktop 3rd Party Integrations
- FME Desktop Administration
- FME Desktop Administration & Configuration
- FME Desktop Development
- FME Desktop Getting Started
- FME Desktop Installation
- FME Desktop Licensing
- FME Desktop Plug-In SDK
- FME Desktop Workbench Scripting
- FME Server 3rd Party Integrations
- FME Server Administration
- FME Server Administration & Configuration
- FME Server Development
- FME Server Getting Started
- FME Server Installation
- FME Server Licensing
- Fanouts
- Ideas FME Cloud
- Ideas FME Desktop: Data Inspector
- Ideas FME Desktop: Formats & Systems
- Ideas FME Desktop: Transformers
- Ideas FME Desktop: Workbench
- Ideas FME Server
- Indoor Mapping
- KML
- Lists
- Performance Tuning
- Point Cloud
- Published Parameters
- Raster
- Real-Time
- Running Multiple Workspaces
- Tabular
- Troubleshooting Techniques
- Vector / GIS
- Web
- Workflow Design
- XML / GML
- Zip Files
- *FME Desktop
- *FME Server
- *FME Cloud
- *Other
- Explore
- Topics
- Questions
- Articles
- Ideas
- Users
- Badges