GteASinEstimate.h
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.0 (2016/06/19)
7 
8 #pragma once
9 
11 
12 // Approximations to asin(x) of the form f(x) = pi/2 - sqrt(1-x)*p(x)
13 // where the polynomial p(x) of degree D minimizes the quantity
14 // maximum{|acos(x)/sqrt(1-x) - p(x)| : x in [0,1]} over all
15 // polynomials of degree D. We use the identity asin(x) = pi/2 - acos(x).
16 
17 namespace gte
18 {
19 
20 template <typename Real>
22 {
23 public:
24  // The input constraint is x in [0,1]. For example,
25  // float x; // in [0,1]
26  // float result = ASinEstimate<float>::Degree<3>(x);
27  template <int D>
28  inline static Real Degree(Real x);
29 };
30 
31 
32 template <typename Real>
33 template <int D>
34 inline Real ASinEstimate<Real>::Degree(Real x)
35 {
36  return (Real)GTE_C_HALF_PI - ACosEstimate<Real>::Degree<D>(x);
37 }
38 
39 
40 }
static Real Degree(Real x)
GLint GLenum GLint x
Definition: glcorearb.h:404
#define GTE_C_HALF_PI
Definition: GteConstants.h:18


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 03:59:59