MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / planish_line

Function planish_line

src/__init__.py:23366–23379  ·  view source on GitHub ↗

Compute matrix which maps line from p1 to p2 to the x-axis, such that it maintains its length and p1 * matrix = Point(0, 0). Args: p1, p2: point_like Returns: Matrix which maps p1 to Point(0, 0) and p2 to a point on the x axis at the same distance to Point(0,0).

(p1: point_like, p2: point_like)

Source from the content-addressed store, hash-verified

23364
23365
23366def planish_line(p1: point_like, p2: point_like) -> Matrix:
23367 """Compute matrix which maps line from p1 to p2 to the x-axis, such that it
23368 maintains its length and p1 * matrix = Point(0, 0).
23369
23370 Args:
23371 p1, p2: point_like
23372 Returns:
23373 Matrix which maps p1 to Point(0, 0) and p2 to a point on the x axis at
23374 the same distance to Point(0,0). Will always combine a rotation and a
23375 transformation.
23376 """
23377 p1 = Point(p1)
23378 p2 = Point(p2)
23379 return Matrix(util_hor_matrix(p1, p2))
23380
23381
23382class JM_image_reporter_Filter(mupdf.PdfFilterOptions2):

Callers 3

is_convexMethod · 0.85
recover_line_quadFunction · 0.85
recover_span_quadFunction · 0.85

Calls 3

PointClass · 0.85
MatrixClass · 0.85
util_hor_matrixFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…