Get coordinates of a vertex projected to a triangle.
(r, best, r1, nn, r12, r13, a, b, c)
| 425 | |
| 426 | @jit() |
| 427 | def _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 | |
| 446 | def _project_onto_surface( |
no test coverage detected