MCPcopy Create free account
hub / github.com/city-super/Octree-GS / cartesianToSpherical

Function cartesianToSpherical

SIBR_viewers/src/core/graphics/Utils.cpp:41–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39 }
40
41 sibr::Vector2d cartesianToSpherical(const sibr::Vector3d & dir)
42 {
43 double theta = std::acos(dir.z());
44
45 double phi = 0;
46 if (dir.x() != 0 && dir.y() != 0) {
47 phi = std::atan2(dir.y(), dir.x());
48 }
49
50 return sibr::Vector2d(phi, theta);
51 }
52
53 sibr::Vector2d cartesianToSphericalUVs(const sibr::Vector3d & dir)
54 {

Callers 1

cartesianToSphericalUVsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected