Cartesian or Polar Coordinates to store intergalactic objects in DB?

Click For Summary

Discussion Overview

The discussion revolves around the choice between Cartesian and Polar coordinates for storing intergalactic objects in a database, particularly in the context of a spaceship simulator game set in infinite space. Participants explore the implications of each coordinate system on data management, object relationships, and computational efficiency.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant suggests that Polar coordinates may complicate the illusion of gravity and proposes using them for tracking objects within their respective subspaces, while estimating distances between different subspaces.
  • Another participant expresses a preference for Cartesian coordinates, citing their familiarity and straightforwardness, while noting the potential complexity of Polar coordinates due to their periodicity and multiple representations.
  • A third participant argues that the choice of coordinate system should depend on the intended use of the data, advocating for Cartesian coordinates if the application involves traveling and rendering objects from various locations.
  • One participant asserts that storing data in 3D Cartesian coordinates is the most sensible approach, referencing real astronomical data and the advantages of using vector arithmetic over trigonometric functions for calculations.

Areas of Agreement / Disagreement

Participants express differing opinions on the suitability of Cartesian versus Polar coordinates, with no consensus reached on which system is definitively better for the proposed application.

Contextual Notes

Participants highlight various factors influencing their preferences, including the complexity of calculations, the nature of object relationships, and the specific requirements of rendering in a game environment.

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.
 

Similar threads

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