MCPcopy
hub / github.com/mne-tools/mne-python / _triangle_coords

Function _triangle_coords

mne/surface.py:427–443  ·  view source on GitHub ↗

Get coordinates of a vertex projected to a triangle.

(r, best, r1, nn, r12, r13, a, b, c)

Source from the content-addressed store, hash-verified

425
426@jit()
427def _triangle_coords(r, best, r1, nn, r12, r13, a, b, c): # pragma: no cover
428 """Get coordinates of a vertex projected to a triangle."""
429 r1 = r1[best]
430 tri_nn = nn[best]
431 r12 = r12[best]
432 r13 = r13[best]
433 a = a[best]
434 b = b[best]
435 c = c[best]
436 rr = r - r1
437 z = np.sum(rr * tri_nn)
438 v1 = np.sum(rr * r12)
439 v2 = np.sum(rr * r13)
440 det = a * b - c * c
441 x = (b * v1 - c * v2) / det
442 y = (a * v2 - c * v1) / det
443 return x, y, z
444
445
446def _project_onto_surface(

Callers 1

_find_nearest_tri_ptsFunction · 0.85

Calls 1

sumMethod · 0.45

Tested by

no test coverage detected