MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / sph_to_cart_position

Function sph_to_cart_position

examples/pde/bhrt.cpp:405–417  ·  view source on GitHub ↗

* @brief Transform the position vectors from spherical to cartesian coordinates * * @param pos * @return af::array */

Source from the content-addressed store, hash-verified

403 * @return af::array
404 */
405af::array sph_to_cart_position(const af::array& pos) {
406 af::array r = pos(0, af::span);
407 af::array o = pos(1, af::span);
408 af::array p = pos(2, af::span);
409
410 af::array x = r * af::sin(o) * af::cos(p);
411 af::array y = r * af::sin(o) * af::sin(p);
412 af::array z = r * af::cos(o);
413
414 af::array transformed_pos = af::join(0, x, y, z);
415
416 return transformed_pos;
417}
418
419/**
420 * @brief Computes the inverse of a 4x4 matrix with the layout

Callers 1

generate_imageFunction · 0.85

Calls 3

sinFunction · 0.85
cosFunction · 0.85
joinFunction · 0.50

Tested by

no test coverage detected