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

Function RandomSphere

Common/DataModel/Testing/Cxx/UnitTestTriangleIntersection.cxx:214–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214void RandomSphere(vtkRandom* seq, const double radius, const double* offset, double* value)
215{
216 // Generate a point on a sphere.
217
218 seq->Next();
219 double theta = 2. * vtkMath::Pi() * seq->GetValue();
220 seq->Next();
221 double phi = vtkMath::Pi() * seq->GetValue();
222 value[0] = radius * cos(theta) * sin(phi) + offset[0];
223 value[1] = radius * sin(theta) * sin(phi) + offset[1];
224 value[2] = radius * cos(phi) + offset[2];
225}
226
227int TestNegativeResult(vtkRandom* seq, unsigned nTests)
228{

Callers 2

TestNegativeResultFunction · 0.70

Calls 5

PiFunction · 0.85
cosFunction · 0.50
sinFunction · 0.50
NextMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected