README.md (2405B)
1 <!-- 2 3 @license Apache-2.0 4 5 Copyright (c) 2018 The Stdlib Authors. 6 7 Licensed under the Apache License, Version 2.0 (the "License"); 8 you may not use this file except in compliance with the License. 9 You may obtain a copy of the License at 10 11 http://www.apache.org/licenses/LICENSE-2.0 12 13 Unless required by applicable law or agreed to in writing, software 14 distributed under the License is distributed on an "AS IS" BASIS, 15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 See the License for the specific language governing permissions and 17 limitations under the License. 18 19 --> 20 21 # Arcversine 22 23 > Compute the [inverse versed sine][inverse-versed-sine]. 24 25 <section class="intro"> 26 27 The [inverse versed sine][inverse-versed-sine] is defined as 28 29 <!-- <equation class="equation" label="eq:arcversine" align="center" raw="\operatorname{aversin}(\theta) = \arccos(1-\theta)" alt="Inverse versed sine."> --> 30 31 <div class="equation" align="center" data-raw-text="\operatorname{aversin}(\theta) = \arccos(1-\theta)" data-equation="eq:arcversine"> 32 <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@bb29798906e119fcb2af99e94b60407a270c9b32/lib/node_modules/@stdlib/math/base/special/aversin/docs/img/equation_arcversine.svg" alt="Inverse versed sine."> 33 <br> 34 </div> 35 36 <!-- </equation> --> 37 38 </section> 39 40 <!-- /.intro --> 41 42 <section class="usage"> 43 44 ## Usage 45 46 ```javascript 47 var aversin = require( '@stdlib/math/base/special/aversin' ); 48 ``` 49 50 #### aversin( x ) 51 52 Computes the [inverse versed sine][inverse-versed-sine]. 53 54 ```javascript 55 var v = aversin( 0.0 ); 56 // returns 0.0 57 58 v = aversin( 3.141592653589793/2.0 ); 59 // returns ~2.1783 60 61 v = aversin( 3.141592653589793/6.0 ); 62 // returns ~1.0742 63 ``` 64 65 If `x < 0`, `x > 2`, or `x` is `NaN`, the function returns `NaN`. 66 67 ```javascript 68 var v = aversin( -1.0 ); 69 // returns NaN 70 71 v = aversin( 3.14 ); 72 // returns NaN 73 74 v = aversin( NaN ); 75 // returns NaN 76 ``` 77 78 </section> 79 80 <!-- /.usage --> 81 82 <section class="examples"> 83 84 ## Examples 85 86 <!-- eslint no-undef: "error" --> 87 88 ```javascript 89 var linspace = require( '@stdlib/array/linspace' ); 90 var aversin = require( '@stdlib/math/base/special/aversin' ); 91 92 var x = linspace( 0.0, 2.0, 100 ); 93 var i; 94 95 for ( i = 0; i < x.length; i++ ) { 96 console.log( aversin( x[ i ] ) ); 97 } 98 ``` 99 100 </section> 101 102 <!-- /.examples --> 103 104 <section class="links"> 105 106 [inverse-versed-sine]: https://en.wikipedia.org/wiki/Versine 107 108 </section> 109 110 <!-- /.links -->