Return the matrix that maps two points C, P to the x-axis such that C -> (0,0) and the image of P have the same distance.
(C, P)
| 24203 | |
| 24204 | |
| 24205 | def util_hor_matrix(C, P): |
| 24206 | ''' |
| 24207 | Return the matrix that maps two points C, P to the x-axis such that |
| 24208 | C -> (0,0) and the image of P have the same distance. |
| 24209 | ''' |
| 24210 | c = JM_point_from_py(C) |
| 24211 | p = JM_point_from_py(P) |
| 24212 | |
| 24213 | # compute (cosine, sine) of vector P-C with double precision: |
| 24214 | s = mupdf.fz_normalize_vector(mupdf.fz_make_point(p.x - c.x, p.y - c.y)) |
| 24215 | |
| 24216 | m1 = mupdf.fz_make_matrix(1, 0, 0, 1, -c.x, -c.y) |
| 24217 | m2 = mupdf.fz_make_matrix(s.x, -s.y, s.y, s.x, 0, 0) |
| 24218 | return JM_py_from_matrix(mupdf.fz_concat(m1, m2)) |
| 24219 | |
| 24220 | |
| 24221 | def match_string(h0, n0): |
no test coverage detected
searching dependent graphs…