## Rectangular (Cartesian) Coordinates

Building star systems logically leads to wanting to associate them to one another—into stellar empires or federations or coalitions, etc., or perhaps two or more allied or competing groups....

And that, then, also causes the Worldbuilder to want to answer questions like "How far is it between Star A and Star B?"

The most straightforward method for placing star systems in a 3-dimensional space—and easily being able to answer questions like the one above—is to use a 3-dimensional rectangular (or Cartesian) coordinate system.

And that, then, also causes the Worldbuilder to want to answer questions like "How far is it between Star A and Star B?"

The most straightforward method for placing star systems in a 3-dimensional space—and easily being able to answer questions like the one above—is to use a 3-dimensional rectangular (or Cartesian) coordinate system.

Before people start trolling me over this, let me state here-and-now that I am fully aware of cylindrical and spherical coordinates and—while both are perfectly adequate for describing the position of points in a 3-dimensional space—both have singular complications that make them less than ideal for Worldbuilding purposes:

1) Although there are equations for converting between all three coordinate systems, converting from spherical or cylindrical coordinates to rectangular coordinates can lead to ambiguity as to in which quadrant the x- and y-values of the rectangular coordinates fall.

2) Even if one exclusively uses cylindrical or spherical coordinates to describe the location of points in a 3D space, it is necessary to convert to the rectangular coordinate system to calculate the straight-line distance between any two points, so why not just describe the space using rectangular coordinates in the first place?

Rectangular (or Cartesian) coordinates are noted by the familiar

This system has several advantages:

1. All the coordinates are straight-line measures, in the same units;

2. The direction of the specified point is intuitive based on the signs of the coordinates:

a. A point with all positive coordinates (2, 2, 2) is "ahead" and to the "left" relative to the positive direction of the x-axis and "up" relative to the (x, y) plane;

b. A point with a negative y-coordinate (2, -2, 2) is "ahead" and to the "right" relative to the positive direction of the x-axis, and "up" relative to the (x, y) plane;

c. Any point with a negative z-coordinate is "down" relative to the (x, y) plane, etc.

3. It is a relatively simple matter to calculate the distance between any two points within the volume (see below), using the Pythagorean theorem.

Henceforth in this discussion I will refer to this system as the R-type coordinate system.

*x*and*y*values of the 2-dimensional Cartesian plane, as well as a third value,*z*, denoting the point's distance above or below that plane.This system has several advantages:

1. All the coordinates are straight-line measures, in the same units;

2. The direction of the specified point is intuitive based on the signs of the coordinates:

a. A point with all positive coordinates (2, 2, 2) is "ahead" and to the "left" relative to the positive direction of the x-axis and "up" relative to the (x, y) plane;

b. A point with a negative y-coordinate (2, -2, 2) is "ahead" and to the "right" relative to the positive direction of the x-axis, and "up" relative to the (x, y) plane;

c. Any point with a negative z-coordinate is "down" relative to the (x, y) plane, etc.

3. It is a relatively simple matter to calculate the distance between any two points within the volume (see below), using the Pythagorean theorem.

Henceforth in this discussion I will refer to this system as the R-type coordinate system.

## Orienting the Z-Axis to Find The Center

*Spiral Galaxies*The z-axis of the R-type system is best set as identical to the rotational axis of the spiral galaxy types. By convention, galactic "north" is determined by whichever direction results in an anti-clockwise rotation for the galaxy, so the positive direction of the z-axis would be oriented toward galactic "north". Then, the logical choice for the center if the coordinate system is the location where the rotational axis passes through the rotational plane, placing it at the center of the disk, whether or not a singular gravimetric mass (supermassive black hole—SMB) exists at that point.

For spiral galaxy types, the x-axis of the R-type system will be

*oriented*somewhat arbitrarily. The x-y

*plane*may be clearly defined by the rotational plane of the galaxy, but in which

*direction*the positive x-axis points is not automatically selected by this fact. Thus, the orientation of the x-axis is largely up to the needs/desires/preferences of the mapmaker.

Some potential (but not exhaustive) options for orienting the x-axis might include:

- A line connecting the center of the spiral galaxy to the home star of the primary civilization;
- The direction of the galaxy's peculiar motion as it travels through intergalactic space;
- The line connecting the barycenter of the galaxy to the barycenter of its largest companion galaxy (projected to the invariable plane, if the companion is on an inclined orbit).

*Elliptical and Lenticular Galaxies*Contrary to spiral galaxies, the stars in these types of galaxies often have wildly varying orbital planes around the center of mass, and so the z-axis of the R-type systems for elliptical and lenticular galaxies is best chosen to be identical to the primary, or pole-to-pole axis (see the blog entry on galaxy types: The Universe In a Shoebox). Thus, the x-axis is perhaps best oriented along one of the semi-diameters.

The center of the coordinate system will thus fall on—or at least close to—the center of mass of the galaxy, but, again, the

*orientation*of the positive x-axis direction is left to be arbitrarily chosen by the mapmaker.

The y-axis, finally, will naturally fall along the semi-diameter perpendicular to the x-axis.

**Irregular and Peculiar Galaxies**There may not be a rotational axis of any sort in the case of irregular/peculiar galaxies; indeed, many of the stars may follow non-Keplarian orbits. Thus, the z-axis of the R-type system for these galaxies will not align with a rotational vector, and so it is perhaps best aligned with the shortest physical dimension of the volume. The x-axis, can then be associated as closely as possible to the longest of the three dimensions of the volume. The positive direction of the x-axis for these types of galaxies, then, is limited to two choices, but otherwise is up to the preference of the mapmaker.

Thus, the center of the coordinate system will fall on—or close to—the geometric center of the volume.

The y-axis, by extension, will fall perpendicular to the x-axis, though not usually parallel to—nor necessarily identical with—the medial dimension of the volume.

## Local Area Coordinates

For smaller regions within a larger context (a spiral arm, a region of an elliptical/lenticular, or a subset of an irregular/peculiar galaxy), a particular star or other distinguishing object, such as a black hole, pulsar, etc., can serve as a good "neutral" center point.

In local areas, it is perhaps best to orient the x-axis direction first, and let the z-axis be determined by the perpendicular to the x-y plane.

For local areas in spiral and elliptical/lenticular galaxies, the most logical orientation for the x-y plane is the rotational plane of the larger galaxy, with the z-axis determined by the perpendicular to that plane (galactic "north" and "south").

For local areas in Irregular/peculiar galaxies, the most logical orientation for the x-y plane is the plane formed by the longest and second-longest dimensions of the larger galaxy, with the z-axis determined by the perpendicular.

In local areas, it is perhaps best to orient the x-axis direction first, and let the z-axis be determined by the perpendicular to the x-y plane.

**For Spiral and Elliptical/Lenticular Galaxies**For local areas in spiral and elliptical/lenticular galaxies, the most logical orientation for the x-y plane is the rotational plane of the larger galaxy, with the z-axis determined by the perpendicular to that plane (galactic "north" and "south").

**For Irregular/Peculiar Galaxies**For local areas in Irregular/peculiar galaxies, the most logical orientation for the x-y plane is the plane formed by the longest and second-longest dimensions of the larger galaxy, with the z-axis determined by the perpendicular.

## Calculating The Distance Between Two Points

As stated in the sidebar above, calculating the straight-line distance between two points in the rectangular system is simply a matter of using the three-dimensional expansion of the Pythagorean Theorem:

**Example**Ann has chosen to use the R-type system to specify the locations in a local area of her 'built galaxy. She has decided upon a political unit called the Ranasite Empire, centered on the star Ranas. The first colony of the Ranasite Empire is located on Trusam B, which has coordinates (11,17,12), as measured from Ranas. The farthest colonized world—thus far—is Entor, at coordinates (23,32,44).

A drawback of the rectangular coordinate system is that it does not straightforwardly specify the straight-line distance from the origin to a particular point in the volume, so before we calculate the distance between Trusam B and Entor, let's calculate the straight-line distance from Ranas to Trusam B and also from Ranas to Entor. (We'll assume the coordinates and distances are specified in light-years).

*From Ranas to Trusam B:*

*From Ranas to Entor:*

*From Trusam B to Entor:*

## Relocating the Origin in a 3D Rectangular Coordinate System

In a 2-dimensional rectangular (Cartesian) coordinate plane, a point is said to lie in one of four quadrants, depending on its orientation to the origin point (where the x- and y-axes cross.The distance between any two points is found by using the 2-dimensional version of the Pythagorean Theorem. So, using Point A and Point C from the illustration at left: |

If the origin is moved to another point, subtract the original coordinates of the new origin from all the other coordinates to get their new coordinates from the new origin.

For instance, to move the origin to Point A (into Quadrant I):

Subtract (Ax, Ay) from all other points:

For instance, to move the origin to Point A (into Quadrant I):

Subtract (Ax, Ay) from all other points:

The former Point A has now become the origin, and the former origin is now Point A, and has moved in to Quadrant III. Point B has moved from Quadrant II into Quadrant III. Point C is still in Quadrant III, but is now twice as far from the origin, and Point D remains in Quadrant IV, having moved closer to the y-axis and farther from the x-axis.

This subtraction of the former coordinates of the new origin from the former coordinates of all other points works consistently, no matter which coordinate is being moved into; thus, the same procedure works for three-dimensional coordinates, as well.

If we add a z-coordinate to Point B, such that it is now located at (-12, -2, -6), and a z-coordinate to Point D, such that it is now located at (2, -12, -9), the distance between them becomes:

This subtraction of the former coordinates of the new origin from the former coordinates of all other points works consistently, no matter which coordinate is being moved into; thus, the same procedure works for three-dimensional coordinates, as well.

If we add a z-coordinate to Point B, such that it is now located at (-12, -2, -6), and a z-coordinate to Point D, such that it is now located at (2, -12, -9), the distance between them becomes:

Whereas in 2-dimensional space, the two points were 17.2047 units apart (see above), in the extended 3-dimensional space, they are separated by 0.2595 additional units, due to both of them having acquired z-coordinates.

## Conclusion

If Ann has more than a few star systems in the Ranasite Empire, doing these calculations and conversions by hand will rapidly become time-consuming and tedious, so it is highly recommended that as you create and place star systems, you keep a database or a spread sheet of their coordinates, so that shifting origins and calculating distances between stars can be automated.