mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
replace implementation <cmath> functions to Sprout.Math.Functions
This commit is contained in:
parent
6ccd6e1cf4
commit
6bb2d0fb87
21 changed files with 212 additions and 106 deletions
|
@ -1,9 +1,11 @@
|
|||
#ifndef SPROUT_DARKROOM_CAMERAS_SIMPLE_CAMERA_HPP
|
||||
#define SPROUT_DARKROOM_CAMERAS_SIMPLE_CAMERA_HPP
|
||||
|
||||
#include <cmath>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/tuple/tuple.hpp>
|
||||
#include <sprout/math/sin.hpp>
|
||||
#include <sprout/math/cos.hpp>
|
||||
#include <sprout/math/sqrt.hpp>
|
||||
#include <sprout/darkroom/coords/vector.hpp>
|
||||
#include <sprout/darkroom/cameras/angle_of_view.hpp>
|
||||
|
||||
|
@ -49,9 +51,9 @@ namespace sprout {
|
|||
unit_type const& v
|
||||
) const
|
||||
{
|
||||
using std::sqrt;
|
||||
using std::sin;
|
||||
using std::cos;
|
||||
using sprout::sqrt;
|
||||
using sprout::sin;
|
||||
using sprout::cos;
|
||||
return transform_1(
|
||||
c,
|
||||
u * cos(rotate_) - v * sin(rotate_),
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#ifndef SPROUT_DARKROOM_COORDS_VECTOR_HPP
|
||||
#define SPROUT_DARKROOM_COORDS_VECTOR_HPP
|
||||
|
||||
#include <cmath>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/tuple/tuple.hpp>
|
||||
#include <sprout/tuple/functions.hpp>
|
||||
#include <sprout/utility/forward.hpp>
|
||||
#include <sprout/math/sqrt.hpp>
|
||||
#include <sprout/darkroom/access/access.hpp>
|
||||
|
||||
namespace sprout {
|
||||
|
@ -63,7 +63,7 @@ namespace sprout {
|
|||
template<typename Vector>
|
||||
inline SPROUT_CONSTEXPR typename sprout::darkroom::access::unit<Vector>::type
|
||||
length(Vector const& vec) {
|
||||
using std::sqrt;
|
||||
using sprout::sqrt;
|
||||
return sqrt(sprout::darkroom::coords::length_sq(vec));
|
||||
}
|
||||
//
|
||||
|
|
|
@ -2,12 +2,13 @@
|
|||
#define SPROUT_DARKROOM_OBJECTS_SPHERE_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <cmath>
|
||||
#include <type_traits>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/tuple/tuple.hpp>
|
||||
#include <sprout/tuple/functions.hpp>
|
||||
#include <sprout/math/constants.hpp>
|
||||
#include <sprout/math/atan2.hpp>
|
||||
#include <sprout/math/sqrt.hpp>
|
||||
#include <sprout/darkroom/access/access.hpp>
|
||||
#include <sprout/darkroom/coords/vector.hpp>
|
||||
#include <sprout/darkroom/rays/ray.hpp>
|
||||
|
@ -142,8 +143,8 @@ namespace sprout {
|
|||
Vec const& normal
|
||||
) const
|
||||
{
|
||||
using std::atan2;
|
||||
using std::sqrt;
|
||||
using sprout::atan2;
|
||||
using sprout::sqrt;
|
||||
return typename intersection<Ray>::type(
|
||||
sprout::tuples::get<zw::does_intersect>(zwo),
|
||||
sprout::tuples::get<zw::distance>(zwo),
|
||||
|
@ -205,7 +206,7 @@ namespace sprout {
|
|||
unit_type const& det_sq
|
||||
) const
|
||||
{
|
||||
using std::sqrt;
|
||||
using sprout::sqrt;
|
||||
return intersect_4(
|
||||
ray,
|
||||
zweitens(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue