original_docstring: Provides node calculations based on an array of (lat, lon) points in radians.
       points is a (N x 1) array where N >= 3
    
docstring: Provides node calculations based on an array of (lat, lon) points in radians.
  points is a (N x 1) array where N >= 3
docstring_tokens: Provides node calculations based on an array of ( lat lon ) points in radians . points is a ( N x 1 ) array where N > = 3
code: def node_calculations(points):
    """Provides node calculations based on an array of (lat, lon) points in radians.
       points is a (N x 1) array where N >= 3
    """
    if len(points) < 3:
      raise(IndexError)
  
    # Get the vector representation of node points in cartesian plane.
    # (N-1, 2) array. Not including (0., 0.)
    v = vectors(points) * R
  
    # Calculate the vector magnitudes (or distance)
    # (N-1, 1) array. No distance for v[-1]
    d = np.linalg.norm(v, axis=1)
  
    # Calculate the bearing (from true north clockwise) for every node.
    # (N-1, 1) array. No bearing for v[-1]
    b = np.arctan2(v[:, 0], v[:, 1])
  
    # Add origin to vector space. (i.e first node in list)
    v = np.concatenate(([[0., 0.]], v))
  
    # Provide distance to previous node and distance to next node
    dp = np.concatenate(([0.], d))
    dn = np.concatenate((d, [0.]))
  
    # Provide cumulative distance on route
    dr = np.cumsum(dp, axis=0)
  
    # Bearing of last node should keep bearing from previous.
    b = np.concatenate((b, [b[-1]]))
  
    return v, dp, dn, dr, b
code_tokens: def node_calculations ( points ) : if len ( points ) < 3 : raise ( IndexError ) v = vectors ( points ) * R d = np . linalg . norm ( v , axis = 1 ) b = np . arctan2 ( v [ : , 0 ] , v [ : , 1 ] ) v = np . concatenate ( ( [ [ 0. , 0. ] ] , v ) ) dp = np . concatenate ( ( [ 0. ] , d ) ) dn = np . concatenate ( ( d , [ 0. ] ) ) dr = np . cumsum ( dp , axis = 0 ) b = np . concatenate ( ( b , [ b [ - 1 ] ] ) ) return v , dp , dn , dr , b
short_docstring: Provides node calculations based on an array of (lat, lon) points in radians.
short_docstring_tokens: Provides node calculations based on an array of ( lat lon ) points in radians .
comment: """Provides node calculations based on an array of (lat, lon) points in radians.
       points is a (N x 1) array where N >= 3
    """$SEP$# Get the vector representation of node points in cartesian plane.$SEP$# (N-1, 2) array. Not including (0., 0.)$SEP$# Calculate the vector magnitudes (or distance)$SEP$# (N-1, 1) array. No distance for v[-1]$SEP$# Calculate the bearing (from true north clockwise) for every node.$SEP$# (N-1, 1) array. No bearing for v[-1]$SEP$# Add origin to vector space. (i.e first node in list)$SEP$# Provide distance to previous node and distance to next node$SEP$# Provide cumulative distance on route$SEP$# Bearing of last node should keep bearing from previous.