Cartesian or Polar Coordinates to store intergalactic objects in DB?

Click For Summary
The discussion revolves around the choice between Cartesian and Polar coordinates for storing intergalactic objects in a database for a spaceship simulator game set in infinite space. The proposed hierarchical structure includes a parent-child relationship among objects, such as clusters, galaxies, solar systems, and individual celestial bodies. The main argument for using Polar coordinates is the potential ease of managing orbits and gravitational relationships, while Cartesian coordinates are favored for their straightforwardness and familiarity, making them easier to relate to the physical world. The consensus leans towards Cartesian coordinates for their practicality in rendering and navigating the game environment, as they facilitate simpler calculations for distances and transformations. Additionally, the use of 3D Cartesian coordinates allows for efficient data manipulation, including velocity and rotation, by leveraging vector arithmetic. The choice ultimately depends on the specific requirements of the game and how the data will be utilized.
Can Not
Messages
1
Reaction score
0
So I'm wondering, should I use Cartesian or Polar Coordinates to store intergalactic objects in DB?

I'm currently prototyping a game idea that can be oversimplified as a spaceship simulator in infinite space. I'm considering grouping objects together so that they have a "parent super-space" as follows:

A cluster would be an object where the parent space is the universe.
A galaxy's parent space is a cluster.
A solar system's parent space is a galaxy.
A star/planet's parent space is a solar system.
Any other smaller object would occupy the sub space of any of the above.

For example, if a planet left a solar system, then it would be in the galaxy's subspace. The user will be able to fly their ship anywhere they feel like.

My reasoning for this is that I think it would be a lot harder to maintain the illusion of "real enough gravity" if things were stored in Cartesian coordinates.

I think there would be a draw back in calculating distances between 2 game objects, but if they are not in the same subspace then I could probably just estimate with the distances between their subspaces.

Would you pick Cartesian or Polar coordinates for this kind of project?
 
Technology news on Phys.org
I presume you are talking about 3D, right? In which case, Polar coordinates do not apply.

I personally prefer Cartesian as they are the first ones I learned from before I knew anything...I have been measuring width, height, and depth of stuff for a while now...it just seems a lot more natural and straight forward and easily relate-able to the physical world.

X,Y,Z is always X,Y,Z...spherical/cylindrical coordinates have more than one way to be represented and their values have periodicity which may add complexity to handling values.

But that is just me...

...then again, if you are going to be keeping track of planets orbiting about their suns, and solar systems about their galaxy's center...maybe polar is good enough for that alone and then keep track of the orientation of the respective local coordinate systems and be prepare to do transformation, etc.

bla, bla, bla
 
The best way to store data is 100% based on how you will use the data.
If you are going to be traveling among these objects and rendering them to the GUI from different locations, then that would strongly favor Cartesian.
 
The data should be stored in 3D Cartesian coordinates, that is really the only sensible solution.

Real data observed from our solar system is available as RA, Dec and red shift.
That will be converted only once from polar to rectangular with heavy use of trig functions.
The computation then becomes matrix or vector arithmetic, trig functions can be avoided.

The database would have a hierarchical structure where the position of objects would be the sum of a few 3D vectors from an origin. Entire clusters could be moved by changing one 3D vector.

Velocity and rotation can also be implemented in the 3D space.
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 10 ·
Replies
10
Views
2K
Replies
13
Views
3K
  • · Replies 24 ·
Replies
24
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K