Calculating Chain Rank |
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 component is used to sort the chain around its to-node. The ffffff and tttttt components are calculated using the following formula:
R | |
Q |
is the quadrant number (1 to 4, Quadrant Numbers) that contains the angle for the chain. For the ffffff component, is defined by the vector FD0, 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 TDL, 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 where is the clockwise angle from the chain to the positive x-axis (due east). |
The tangent term is called the half-angle tangent. Since 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.
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
since
then
Calculating Rank in Quadrant 1
The following calculations were used to determine the rank in Calculating Rank in Quadrant 2:
given
since
then
Calculating Rank in Quadrant 2
The following calculations were used to determine the rank in Calculating Rank in Quadrant 3:
given
since
then
Calculating Rank in Quadrant 3
The following calculations were used to determine the rank in Calculating Rank in Quadrant 4:
given
since
then
Calculating Rank in Quadrant 4
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.