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, and 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 in a Quadrant

The following figure illustrates the relationship of the quadrants to each other. Note that their numerical order is counterclockwise.
Quadrant Numbers
Quadrant Numbers
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
formula for RANK values
Because
then
Calculating Rank in Quadrant 1
Calculating Rank in Quadrant 1
The following calculations were used to determine the rank in Calculating Rank in Quadrant 2:
Given
formula for RANK values
Because
then
Calculating Rank in Quadrant 2
Calculating Rank in Quadrant 2
The following calculations were used to determine the rank in Calculating Rank in Quadrant 3:
Given
formula for RANK values
Because
then
Calculating Rank in Quadrant 3
Calculating Rank in Quadrant 3
The following calculations were used to determine the rank in Calculating Rank in Quadrant 4:
Given
formula for RANK values
Because
then
Calculating Rank in Quadrant 4
Calculating Rank in Quadrant 4