MCPcopy Index your code
hub / github.com/plotly/plotly.py / value_at

Method value_at

plotly/figure_factory/_streamline.py:176–194  ·  view source on GitHub ↗

Set up for RK4 function, based on Bokeh's streamline code

(self, a, xi, yi)

Source from the content-addressed store, hash-verified

174 return (int((xi / self.spacing_x) + 0.5), int((yi / self.spacing_y) + 0.5))
175
176 def value_at(self, a, xi, yi):
177 """
178 Set up for RK4 function, based on Bokeh's streamline code
179 """
180 if isinstance(xi, np.ndarray):
181 self.x = xi.astype(int)
182 self.y = yi.astype(int)
183 else:
184 self.val_x = int(xi)
185 self.val_y = int(yi)
186 a00 = a[self.val_y, self.val_x]
187 a01 = a[self.val_y, self.val_x + 1]
188 a10 = a[self.val_y + 1, self.val_x]
189 a11 = a[self.val_y + 1, self.val_x + 1]
190 xt = xi - self.val_x
191 yt = yi - self.val_y
192 a0 = a00 * (1 - xt) + a01 * xt
193 a1 = a10 * (1 - xt) + a11 * xt
194 return a0 * (1 - yt) + a1 * yt
195
196 def rk4_integrate(self, x0, y0):
197 """

Callers 2

fMethod · 0.95
gMethod · 0.95

Calls 1

intFunction · 0.85

Tested by

no test coverage detected