| 676 | } |
| 677 | |
| 678 | inline 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 | } |
no test coverage detected