MCPcopy Create free account
hub / github.com/TheRealMJP/DeferredTexturing / CartesianToSpherical

Function CartesianToSpherical

SampleFramework12/v1.00/SF12_Math.h:678–687  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

676}
677
678inline Float2 CartesianToSpherical(const Float3& xyz)
679{
680 float elevation = std::asin(xyz.y);
681
682 float azimuth = std::atan2(xyz.z, xyz.x);
683 if(azimuth < 0.0f)
684 azimuth = 2.0f * Pi + azimuth;
685
686 return Float2(azimuth, elevation);
687}
688
689}

Callers 2

InitializeMethod · 0.85
UpdateMethod · 0.85

Calls 1

Float2Class · 0.85

Tested by

no test coverage detected