From UFStarfleet Wiki
Many centuries ago, when man first started to explore the stars he had to think in greater terms than those bound to the soil of the earth. The known compass directions of North, South, East and West became insufficient terms for referring to directions within the galaxy. Instead, the following conventions have achieved widespread acceptance throughout the Federation and beyond when referring to direction in space.
The Milky Way Galaxy
Unlike a planet which is spherical, the Milky Way galaxy is an almost flat disc which stellar cartographers have divided into four quadrants. The Alpha Quadrant is where the Sol System and the vast majority of Federation space is. The Beta Quadrant is home to both the Klingon and Romulan Empires. The Delta Quadrant is where the USS Voyager became stranded and is now of course home to UFS. The Gamma Quadrant is at the terminus end of the Bajoran Wormhole and where the Dominion exists. The four quadrants are positioned in an anti-clockwise direction.
The illustration above shows the Milky Way galaxy from the edge as a disc, or as it’s more commonly referred to as the 'Galactic Plane'. There are only two directions that apply to the galaxy when looking at it from the galactic plane. They are ‘Galactic North’ and 'Galactic South'. You can also think of these as simply ‘Up’ and ‘Down’. We could always be looking at the galactic plane from anywhere along its edge so without a fixed reference point no other directions bear any relevance.
The illustration above now shows the Milky Way flipped through 90 degrees, or from a ‘birds-eye’ view. It is this view of the galaxy that stellar cartographers use to map the location of stars and other celestial objects and phenomena. You can now also see the galaxy’s spiral arms.
As far as mapping is concerned there are four cardinal directions that are used. They are coreward, spinward, rimward and trailing.
Coreward refers the direction of the galactic core, the centre of the galactic coordinate system. Coreward is always mapped at the top of a galactic map.
Rimward is the opposite direction from Coreward, referring to the direction away from the Galactic Core, towards the galactic rim. It is always mapped at the bottom of a galactic map.
Spinward refers to the direction of the Galactic Spin, i.e. the direction the galaxy is rotating to. On star maps, Spinward is mapped on the left hand side of the map.
Trailing, the final of the four galactic directions, refers to the direction against the Galactic Spin, i.e. the direction contrary to the galaxy's movement around its own axis. Trailing is usually mapped on the right hand side of the map.
The illustration shows these four coordinates on the galactic map, however the same applies when looking at a quadrant, sector, or even system map. Because the galaxy is a round, moving structure, these are relative directional terms rather than astrographical terms.
When areas of charted space overlap between more than one directional bearing, standard custom is to use a clock pattern to assign them in order, with the direction first on the clock taking precedence, followed by the succeeding direction separated by a hyphen. Hence the Gamma Quadrant is called the "Spinward-Coreward Quadrant, the Delta Quadrant is called the "Coreward-Trailing Quadrant", the Beta Quadrant is the "Trailing-Rimward Quadrant", and the Alpha Quadrant is the "Rimward-Spinward Quadrant." Movements along an angular vector that lies between two directions is handled similarly, so that a ship moving from the upper left quadrant to the lower right is on a "Trailing-Rimward Vector."
Galactic Coordinate System
So the four cardinal directions give us a general feel for the locations of things in the galaxy. Precise galactic coordinates however are handled in a completely different manner. The actual position of a celestial object is measured from yours or your ships position in two ways ... distance and bearing.
Distance is normally measured by using one of three units of length.
An Astronomical Unit (abbreviated as AU) is a unit of length equal to about 92,960,000 miles. One AU is defined as the mean distance between the Earth and its Sun over one Earth orbit.
A Light-Year (symbol: ly) is a unit of length, equal to about 6 trillion miles. It is the distance that light travels in a vacuum in one year.
The Parsec (symbol: pc) is a unit of length, equal to about 19 trillion miles, or about 3.26 light-years.
Light years are by far the most common way to express distance in space, however any and all of these three terms is also correct.
So, we can now identify how far an object is away from us by using one of the above mentioned units of measure. However to establish its exact position in relation to ours we also need to establish its bearing. This is done by identifying both the relative bearing and the absolute bearing.
Relative Bearing is the Flight vector specified as an azimuth/elevation relative to the ship's orientation. Measured through an arc of 360 degrees on a horizontal plane. ("000-mark-0" is straight ahead).
A relative bearing of between 000 and 180 will be to the starboard (right) side, whereas a bearing of between 181 and 359 will be to the port side.
Absolute Bearing (referred to commonly as 'mark') is the Flight vector specified as an azimuth/elevation relative to the galaxy. Measured through 360 degrees on a vertical plane. ("000-mark-0" is the galactic center).
An absolute bearing of between 000 and 090 will be above you to the fore, whereas an absolute bearing of between 091 and 180 will be above you to the aft.
An absolute bearing of between 181 and 270 will be below you to the aft, whereas an absolute bearing of between 271 and 359 will be below you to the fore.
The diagrams below (courtesy of http://www.lcarscom.net) clearly illustrate relative and absolute bearing.