parameters: (u, v=Vector(1, 0, 0), normal=Vector(0, 0, 1))
docstring: Return the angle in radians between the two vectors.
  
      It uses the definition of the dot product
      ::
          A * B = |A||B| cos(angle)
  
      If only one vector is given, the angle is between that one and the
      horizontal (+X).
  
      If a third vector is given, it is the normal used to determine
      the sign of the angle.
      This normal is used to calculate a `factor` as the dot product
      with the cross product of the first two vectors.
      ::
          C = A x B
          factor = normal * C
  
      If the `factor` is positive the angle is positive, otherwise
      it is the opposite sign.
  
      Parameters
      ----------
      u : Base::Vector3
          The first vector.
      v : Base::Vector3, optional
          The second vector to test against the first one.
          It defaults to `(1, 0, 0)`, or +X.
      normal : Base::Vector3, optional
          The vector indicating the normal.
          It defaults to `(0, 0, 1)`, or +Z.
  
      Returns
      -------
      float
          The angle in radians between the vectors.
          It is zero if the magnitude of one of the vectors is zero,
          or if they are colinear.
docstring_summary: Return the angle in radians between the two vectors.
docstring_tokens: Return the angle in radians between the two vectors .
function: def angle(u, v=Vector(1, 0, 0), normal=Vector(0, 0, 1)):
      """Return the angle in radians between the two vectors.
  
      It uses the definition of the dot product
      ::
          A * B = |A||B| cos(angle)
  
      If only one vector is given, the angle is between that one and the
      horizontal (+X).
  
      If a third vector is given, it is the normal used to determine
      the sign of the angle.
      This normal is used to calculate a `factor` as the dot product
      with the cross product of the first two vectors.
      ::
          C = A x B
          factor = normal * C
  
      If the `factor` is positive the angle is positive, otherwise
      it is the opposite sign.
  
      Parameters
      ----------
      u : Base::Vector3
          The first vector.
      v : Base::Vector3, optional
          The second vector to test against the first one.
          It defaults to `(1, 0, 0)`, or +X.
      normal : Base::Vector3, optional
          The vector indicating the normal.
          It defaults to `(0, 0, 1)`, or +Z.
  
      Returns
      -------
      float
          The angle in radians between the vectors.
          It is zero if the magnitude of one of the vectors is zero,
          or if they are colinear.
      """
      typecheck([(u, Vector), (v, Vector)], "angle")
      ll = u.Length * v.Length
      if ll == 0:
          return 0
  
      # The dot product indicates the projection of one vector over the other
      dp = u.dot(v)/ll
  
      # Due to rounding errors, the dot product could be outside
      # the range [-1, 1], so let's force it to be within this range.
      if dp < -1:
          dp = -1
      elif dp > 1:
          dp = 1
  
      ang = math.acos(dp)
  
      # The cross product compared with the provided normal
      normal1 = u.cross(v)
      coeff = normal.dot(normal1)
      if coeff >= 0:
          return ang
      else:
          return -ang
function_tokens: def angle ( u , v = Vector ( 1 , 0 , 0 ) , normal = Vector ( 0 , 0 , 1 ) ) : typecheck ( [ ( u , Vector ) , ( v , Vector ) ] , "angle" ) ll = u . Length * v . Length if ll == 0 : return 0 # The dot product indicates the projection of one vector over the other dp = u . dot ( v ) / ll # Due to rounding errors, the dot product could be outside # the range [-1, 1], so let's force it to be within this range. if dp < - 1 : dp = - 1 elif dp > 1 : dp = 1 ang = math . acos ( dp ) # The cross product compared with the provided normal normal1 = u . cross ( v ) coeff = normal . dot ( normal1 ) if coeff >= 0 : return ang else : return - ang