MCPcopy Create free account
hub / github.com/Image-Py/imagepy / f

Function f

imagepy/core/draw/polygonfill.py:9–12  ·  view source on GitHub ↗
(p1,p2,y)

Source from the content-addressed store, hash-verified

7import numpy as np
8
9def f(p1,p2,y):
10 if abs(p1[1]-y) > abs(p2[1]-y):p1,p2 = p2,p1
11 k =1.0* (p1[1]-y)/(y-p2[1])
12 return round((p1[0]+k*p2[0])/(1+k),4)
13
14def scan(polys, idx, ys, st, y, cur, buf):
15 while cur<len(idx) and ys[st[cur]]<=y:

Callers 1

rootsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected