original_docstring: Construct an OrientedBoundingBox from points.
  
          : param points: The points at four corners.
  
          NOTE: We assume that the points are from a rectangle(now skew or tapering).
                If there is some doubt, consider passing:
                ```
                shapely.geometry.Polygon(points).minimum_rotated_rectangle.coords
                ```
          
docstring: Construct an OrientedBoundingBox from points.
docstring_tokens: Construct an OrientedBoundingBox from points .
code: def from_points(points):
          """Construct an OrientedBoundingBox from points.
  
          : param points: The points at four corners.
  
          NOTE: We assume that the points are from a rectangle(now skew or tapering).
                If there is some doubt, consider passing:
                ```
                shapely.geometry.Polygon(points).minimum_rotated_rectangle.coords
                ```
          """
          points = np.asanyarray(points)
          ctr = points.mean(0)
          vectors = points - ctr
          u = ((vectors[0] + vectors[3]) - (vectors[1] + vectors[2])) / 2.
          angle = np.arctan2(u[1], u[0])
          angle = (angle + 2 * np.pi) % (np.pi / 2.)
          uax = np.cos(angle)
          uay = np.sin(angle)
          assert uax >= 0 and uay >= 0
  
          u_length = vectors.dot([uax, uay]).max()
          v_length = vectors.dot([-uay, uax]).max()
          ux, uy = u_length * np.array([uax, uay])
  
          return OrientedBoundingBox(ctr[0], ctr[1], ux, uy, v_length)
code_tokens: def from_points ( points ) : points = np . asanyarray ( points ) ctr = points . mean ( 0 ) vectors = points - ctr u = ( ( vectors [ 0 ] + vectors [ 3 ] ) - ( vectors [ 1 ] + vectors [ 2 ] ) ) / 2. angle = np . arctan2 ( u [ 1 ] , u [ 0 ] ) angle = ( angle + 2 * np . pi ) % ( np . pi / 2. ) uax = np . cos ( angle ) uay = np . sin ( angle ) assert uax >= 0 and uay >= 0 u_length = vectors . dot ( [ uax , uay ] ) . max ( ) v_length = vectors . dot ( [ - uay , uax ] ) . max ( ) ux , uy = u_length * np . array ( [ uax , uay ] ) return OrientedBoundingBox ( ctr [ 0 ] , ctr [ 1 ] , ux , uy , v_length )
short_docstring: Construct an OrientedBoundingBox from points.
short_docstring_tokens: Construct an OrientedBoundingBox from points .
comment: """Construct an OrientedBoundingBox from points.
  
          : param points: The points at four corners.
  
          NOTE: We assume that the points are from a rectangle(now skew or tapering).
                If there is some doubt, consider passing:
                ```
                shapely.geometry.Polygon(points).minimum_rotated_rectangle.coords
                ```
          """