original_docstring: Calculate the direction of the spar component based on a location
      at the upper surface for the cruise airfoil.
docstring: Calculate the direction of the spar component based on a location
  at the upper surface for the cruise airfoil.
docstring_tokens: Calculate the direction of the spar component based on a location at the upper surface for the cruise airfoil .
code: def calculate_spar_direction(psi_baseline, Au_baseline, Au_goal, deltaz, c_goal, l_LE, eps_LE, psi_spars):
      """Calculate the direction of the spar component based on a location
      at the upper surface for the cruise airfoil."""
      # Calculate cruise chord
      c_baseline = calculate_c_baseline(c_goal, Au_baseline, Au_goal, deltaz, l_LE, eps_LE, psi_spars[0])
      # Calculate psi at goal arifoil
      psi_goal = calculate_psi_goal(psi_baseline, Au_baseline, Au_goal, deltaz, 
                                    c_baseline, c_goal, l_LE, eps_LE, psi_spars[0])
      # non-normalized direction
      s = np.zeros(2)
      t = np.zeros(2)
  #    t_norm = np.sqrt(1 + (dxi_u(psi_goal, Au_goal[0], Au_goal[1], deltaz))**2)
      
      cbeta = calculate_cbeta(psi_baseline, Au_baseline, 
                              deltaz/c_baseline)
      sbeta = np.sqrt(1-cbeta**2)
      
      t[0] = 1
      t[1] = dxi_u(psi_goal, Au_goal, deltaz/c_goal)
      t_norm = np.sqrt(t[0]**2 + t[1]**2)
      t = (1./t_norm)*t
  #    s[0] = t_norm*cbeta - dxi_u(psi_goal, Au_goal[0], Au_goal[1], deltaz)
  #    s[1] =  1
      
      s[1] = t[1]*cbeta + t[0]*sbeta
      s[0] = (cbeta - s[1]*t[1])/t[0]
      return s
code_tokens: def calculate_spar_direction ( psi_baseline , Au_baseline , Au_goal , deltaz , c_goal , l_LE , eps_LE , psi_spars ) : c_baseline = calculate_c_baseline ( c_goal , Au_baseline , Au_goal , deltaz , l_LE , eps_LE , psi_spars [ 0 ] ) psi_goal = calculate_psi_goal ( psi_baseline , Au_baseline , Au_goal , deltaz , c_baseline , c_goal , l_LE , eps_LE , psi_spars [ 0 ] ) s = np . zeros ( 2 ) t = np . zeros ( 2 ) cbeta = calculate_cbeta ( psi_baseline , Au_baseline , deltaz / c_baseline ) sbeta = np . sqrt ( 1 - cbeta ** 2 ) t [ 0 ] = 1 t [ 1 ] = dxi_u ( psi_goal , Au_goal , deltaz / c_goal ) t_norm = np . sqrt ( t [ 0 ] ** 2 + t [ 1 ] ** 2 ) t = ( 1. / t_norm ) * t s [ 1 ] = t [ 1 ] * cbeta + t [ 0 ] * sbeta s [ 0 ] = ( cbeta - s [ 1 ] * t [ 1 ] ) / t [ 0 ] return s
short_docstring: Calculate the direction of the spar component based on a location
  at the upper surface for the cruise airfoil.
short_docstring_tokens: Calculate the direction of the spar component based on a location at the upper surface for the cruise airfoil .
comment: """Calculate the direction of the spar component based on a location
      at the upper surface for the cruise airfoil."""$SEP$# Calculate cruise chord
  $SEP$# Calculate psi at goal arifoil
  $SEP$# non-normalized direction
  $SEP$#    t_norm = np.sqrt(1 + (dxi_u(psi_goal, Au_goal[0], Au_goal[1], deltaz))**2)
  $SEP$#    s[0] = t_norm*cbeta - dxi_u(psi_goal, Au_goal[0], Au_goal[1], deltaz)
  $SEP$#    s[1] =  1
  