MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / inside_circle

Function inside_circle

lib/matplotlib/bezier.py:500–514  ·  view source on GitHub ↗

Return a function that checks whether a point is in a circle with center (*cx*, *cy*) and radius *r*. The returned function has the signature:: f(xy: tuple[float, float]) -> bool

(cx, cy, r)

Source from the content-addressed store, hash-verified

498
499
500def inside_circle(cx, cy, r):
501 """
502 Return a function that checks whether a point is in a circle with center
503 (*cx*, *cy*) and radius *r*.
504
505 The returned function has the signature::
506
507 f(xy: tuple[float, float]) -> bool
508 """
509 r2 = r ** 2
510
511 def _f(xy):
512 x, y = xy
513 return (x - cx) ** 2 + (y - cy) ** 2 < r2
514 return _f
515
516
517# quadratic Bezier lines

Callers 4

__call__Method · 0.85
transmuteMethod · 0.85
transmuteMethod · 0.85

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…