Go to the documentation of this file.
11 #ifndef vtk_m_worklet_CoordinateSystemTransform_h
12 #define vtk_m_worklet_CoordinateSystemTransform_h
31 vec[0] *
static_cast<T
>(
vtkm::Sin(vec[1])),
46 T R =
vtkm::Sqrt(vec[0] * vec[0] + vec[1] * vec[1]);
49 if (vec[0] == 0 && vec[1] == 0)
52 Theta = -
vtkm::ASin(vec[1] / R) +
static_cast<T
>(vtkm::Pi());
74 T sinTheta =
static_cast<T
>(
vtkm::Sin(Theta));
75 T cosTheta =
static_cast<T
>(
vtkm::Cos(Theta));
76 T sinPhi =
static_cast<T
>(
vtkm::Sin(Phi));
77 T cosPhi =
static_cast<T
>(
vtkm::Cos(Phi));
79 T x = R * sinTheta * cosPhi;
80 T y = R * sinTheta * sinPhi;
101 T Phi = vtkm::ATan2(vec[1], vec[0]);
103 Phi +=
static_cast<T
>(vtkm::TwoPi());
111 #endif // vtk_m_worklet_CoordinateSystemTransform_h
VTKM_EXEC_CONT vtkm::Float32 Sqrt(vtkm::Float32 x)
Compute the square root of x.
Definition: Math.h:958
Definition: CoordinateSystemTransform.h:61
#define VTKM_EXEC
Definition: ExportMacros.h:51
Groups connected points that have the same field value.
Definition: Atomic.h:19
VTKM_EXEC_CONT vtkm::Float32 Cos(vtkm::Float32 x)
Compute the cosine of x.
Definition: Math.h:269
Definition: CoordinateSystemTransform.h:88
A control signature tag for output fields.
Definition: WorkletMapField.h:60
Definition: CoordinateSystemTransform.h:21
VTKM_EXEC vtkm::Vec< T, 3 > operator()(const vtkm::Vec< T, 3 > &vec) const
Definition: CoordinateSystemTransform.h:68
VTKM_EXEC vtkm::Vec< T, 3 > operator()(const vtkm::Vec< T, 3 > &vec) const
Definition: CoordinateSystemTransform.h:44
_2(_1) ExecutionSignature
Definition: CoordinateSystemTransform.h:91
VTKM_EXEC_CONT vtkm::Float32 Sin(vtkm::Float32 x)
Compute the sine of x.
Definition: Math.h:210
void(FieldIn, FieldOut) ControlSignature
Definition: CoordinateSystemTransform.h:90
VTKM_EXEC_CONT vtkm::Float32 ASin(vtkm::Float32 x)
Compute the arc sine of x.
Definition: Math.h:387
VTKM_EXEC vtkm::Vec< T, 3 > operator()(const vtkm::Vec< T, 3 > &vec) const
Definition: CoordinateSystemTransform.h:28
A control signature tag for input fields.
Definition: WorkletMapField.h:49
void(FieldIn, FieldOut) ControlSignature
Definition: CoordinateSystemTransform.h:23
void(FieldIn, FieldOut) ControlSignature
Definition: CoordinateSystemTransform.h:39
_2(_1) ExecutionSignature
Definition: CoordinateSystemTransform.h:24
Definition: CoordinateSystemTransform.h:37
_2(_1) ExecutionSignature
Definition: CoordinateSystemTransform.h:40
VTKM_EXEC vtkm::Vec< T, 3 > operator()(const vtkm::Vec< T, 3 > &vec) const
Definition: CoordinateSystemTransform.h:95
VTKM_EXEC_CONT vtkm::Float32 ACos(vtkm::Float32 x)
Compute the arc cosine of x.
Definition: Math.h:446
_2(_1) ExecutionSignature
Definition: CoordinateSystemTransform.h:64
void(FieldIn, FieldOut) ControlSignature
Definition: CoordinateSystemTransform.h:63
Base class for worklets that do a simple mapping of field arrays.
Definition: WorkletMapField.h:38