RANK Value Equation

Overview

RANK is the sorting key used to sort multiple chains that have a common node by their angle, starting from 0 at due east and proceeding counterclockwise. A node can be either of the two end-points of a chain.
RANK values have the form ffffff.tttttt, where the ffffff value is used to sort the chain around its from-node and the tttttt value is used to sort the chain around its to-node. The ffffff and tttttt components are calculated using the following formula:
formula for RANK values
where
R
is the calculated ranking factor.
Q
is the quadrant number (1 to 4) that contains the angle α for the chain. See Quadrant Numbers for details of the quadrant numbers.
For the ffffff component, α is defined by the vector F→D0, where F is the from-node and D0 is the first detail point. For chains that have no detail points, D0 is the to-node. For the tttttt component, α is defined by the vector T→DL, where T is the to-node and DL is the last detail point. For chains that have no detail points, DL is the from-node.
A
is the angle from the chain clockwise to the nearest X or Y axis. The angle is determined with formula for chain angles where α is the clockwise angle from the chain to the positive x-axis (due east).
The tangent term is called the half-angle tangent. Because the angle A/2 can never exceed π/4 (45 degrees), the half-angle tangent has values from 0 to 1. The (Q-1) multiplier adjusts the range of values to 0 to 4. The values 0, 1, 2, 3, and 4 represent angles of 0, 90, 180, 270, and just under 360 degrees, respectively.
The 1E5 multiplier is used to transform decimal rank values to integers. Thus, the rank values for a chain have six significant digits.
Note: The trigonometric functions are in radians.

Calculating the Value of a Quadrant

The following figure illustrates the relationship of the quadrants to each other. Note that their numerical order is counterclockwise.
Quadrant Numbers
counterclockwise relationship of quadrants one to four, starting in the upper right quadrant with Q equals one
The following figures illustrate how to calculate the value of A in each quadrant.
The following calculations were used to determine the rank in Calculating Rank in Quadrant 1:
Given
The From-Node RANK value equals the one E five multiplier transform of Q minus one plus the tangent of A divided by two
Because
Q equals one
then
The From-Node RANK value equals the one E five multiplier transform of the tangent of A divided by two
Calculating Rank in Quadrant 1
Calculating Rank in Quadrant one, where A is equal to the tangent to the power of negative one of delta Y divided by delta X
The following calculations were used to determine the rank in Calculating Rank in Quadrant 2:
Given
The From-Node RANK value equals the one E five multiplier transform of Q minus one plus the tangent of A divided by two
Because
Q equals two
then
The From-Node RANK value equals the one E five multiplier transform of two plus the tangent of A divided by two
Calculating Rank in Quadrant 2
Calculating Rank in Quadrant two, where A is equal to the tangent to the power of negative one of delta X divided by delta Y
The following calculations were used to determine the rank in Calculating Rank in Quadrant 3:
Given
The From-Node RANK value equals the one E five multiplier transform of Q minus one plus the tangent of A divided by two
Because
Q equals three
then
The From-Node RANK value equals the one E five multiplier transform of two plus the tangent of A divided by two
Calculating Rank in Quadrant 3
Calculating Rank in Quadrant three, where A is equal to the tangent to the power of negative one of delta Y divided by delta X
The following calculations were used to determine the rank in Calculating Rank in Quadrant 4:
Given
The From-Node RANK value equals the one E five multiplier transform of Q minus one plus the tangent of A divided by two
Because
Q equals four
then
The From-Node RANK value equals the one E five multiplier transform of three plus the tangent of A divided by two
Calculating Rank in Quadrant 4
Calculating Rank in Quadrant four, where A is equal to the tangent to the power of negative one of delta X divided by delta Y