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

Function get_normal_points

lib/matplotlib/bezier.py:149–165  ·  view source on GitHub ↗

For a line passing through (*cx*, *cy*) and having an angle *t*, return locations of the two points located along its perpendicular line at the distance of *length*.

(cx, cy, cos_t, sin_t, length)

Source from the content-addressed store, hash-verified

147
148
149def get_normal_points(cx, cy, cos_t, sin_t, length):
150 """
151 For a line passing through (*cx*, *cy*) and having an angle *t*, return
152 locations of the two points located along its perpendicular line at the
153 distance of *length*.
154 """
155
156 if length == 0.:
157 return cx, cy, cx, cy
158
159 cos_t1, sin_t1 = sin_t, -cos_t
160 cos_t2, sin_t2 = -sin_t, cos_t
161
162 x1, y1 = length * cos_t1 + cx, length * sin_t1 + cy
163 x2, y2 = length * cos_t2 + cx, length * sin_t2 + cy
164
165 return x1, y1, x2, y2
166
167
168# BEZIER routines

Callers 3

_get_bracketMethod · 0.90
get_parallelsFunction · 0.85
make_wedged_bezier2Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…