MCPcopy Create free account
hub / github.com/Kitware/VTK / SphericalToCartesian

Function SphericalToCartesian

IO/NetCDF/vtkMPASReader.cxx:894–912  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

892//------------------------------------------------------------------------------
893
894static int SphericalToCartesian(
895 double rho, double phi, double theta, double* x, double* y, double* z)
896{
897 double tx, ty, tz;
898
899 tx = rho * sin(phi) * cos(theta);
900 ty = rho * sin(phi) * sin(theta);
901 tz = rho * cos(phi);
902 if (vtkMath::IsNan(tx) || vtkMath::IsNan(ty) || vtkMath::IsNan(tz))
903 {
904 return -1;
905 }
906
907 *x = tx;
908 *y = ty;
909 *z = tz;
910
911 return 0;
912}
913
914vtkStandardNewMacro(vtkMPASReader);
915

Callers 1

OutputPointsMethod · 0.85

Calls 3

IsNanFunction · 0.85
sinFunction · 0.50
cosFunction · 0.50

Tested by

no test coverage detected