OpenSiv3D  v0.6.5
C++20 framework for creative coding
s3d::FastMath Namespace Reference

Functions

constexpr std::pair< float, float > SinCos (float angleRadians) noexcept
 sin, cos を高速に近似計算します。 More...
 
constexpr std::pair< float, float > SinCos (double angleRadians) noexcept
 sin, cos を高速に近似計算します。 More...
 
float InvSqrt (float x) noexcept
 逆平方根を高速に近似計算します。 More...
 
double InvSqrt (double x) noexcept
 逆平方根を高速に近似計算します。 More...
 
double InvSqrtQuality (double x) noexcept
 精度の高い逆平方根を高速に近似計算します。 More...
 
float Sqrt (float x) noexcept
 平方根を高速に近似計算します。 More...
 
double Sqrt (double x) noexcept
 平方根を高速に近似計算します。 More...
 

Function Documentation

◆ InvSqrt() [1/2]

double s3d::FastMath::InvSqrt ( double  x)
inlinenoexcept

逆平方根を高速に近似計算します。

Parameters
x逆平方根を計算する値
Returns
逆平方根の近似結果

◆ InvSqrt() [2/2]

float s3d::FastMath::InvSqrt ( float  x)
inlinenoexcept

逆平方根を高速に近似計算します。

Parameters
x逆平方根を計算する値
Returns
逆平方根の近似結果

◆ InvSqrtQuality()

double s3d::FastMath::InvSqrtQuality ( double  x)
inlinenoexcept

精度の高い逆平方根を高速に近似計算します。

Parameters
x逆平方根を計算する値
Remarks
FastMath::InvSqrt() よりもコストがかかりますが、結果の精度が向上します
Returns
逆平方根の近似結果

◆ SinCos() [1/2]

constexpr std::pair<float, float> s3d::FastMath::SinCos ( double  angleRadians)
inlineconstexprnoexcept

sin, cos を高速に近似計算します。

Parameters
angleRadiansラジアン角
Returns
sin, cos の近似結果

◆ SinCos() [2/2]

constexpr std::pair<float, float> s3d::FastMath::SinCos ( float  angleRadians)
inlineconstexprnoexcept

sin, cos を高速に近似計算します。

Parameters
angleRadiansラジアン角
Returns
sin, cos の近似結果

◆ Sqrt() [1/2]

double s3d::FastMath::Sqrt ( double  x)
inlinenoexcept

平方根を高速に近似計算します。

Remarks
x * FastMath::InvSqrt(x) を返します。
Parameters
x平方根を計算する値
Returns
平方根の近似結果

◆ Sqrt() [2/2]

float s3d::FastMath::Sqrt ( float  x)
inlinenoexcept

平方根を高速に近似計算します。

Remarks
x * FastMath::InvSqrt(x) を返します。
Parameters
x平方根を計算する値
Returns
平方根の近似結果