Skip to content

Commit

Permalink
feat: add math/base/special/tand
Browse files Browse the repository at this point in the history
  • Loading branch information
the-r3aper7 committed Mar 12, 2024
1 parent bd5d319 commit 2e030f2
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/math/base/special/tand/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ limitations under the License.

# tand

> Evaluate the [tangent][trigonometric-functions] of a degree.
> Computes the [tangent][trigonometric-functions] of an angle measured in degrees.
<section class="intro">

Expand All @@ -36,7 +36,7 @@ var tand = require( '@stdlib/math/base/special/tand' );

#### tand( x )

Evaluates the [tangent][trigonometric-functions] of `x` (in degree).
Evaluates the [tangent][trigonometric-functions] of `x` (in degrees).

```javascript
var v = tand( 0.0 );
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/math/base/special/tand/docs/repl.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

{{alias}}( x )
Computes the tangent of a degree.
Computes the tangent of an angle measured in degrees.

Parameters
----------
x: number
Input value (in degree).
Input value (in degrees).

Returns
-------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,26 @@
// TypeScript Version: 4.1

/**
* Evaluates the tangent of a degree.
* Computes the tangent of an angle measured in degrees
*
* @param x - input value (in degree)
* @param x - input value (in degrees)
* @returns tangent
*
* @example
* var v = tand( 0.0 );
* // returns 0
*
* @example
* var v = tand( 60 );
* // returns ~1.73
*
* @example
* var v = tand( 90 );
* // returns Infinity
*
* @example
* var v = tand( NaN );
* // returns NaN
*
* @example
* var v = tand( 0.0 );
* // returns 0
*
* @example
* var v = tand( 60 );
* // returns ~1.73
*
* @example
* var v = tand( 90 );
* // returns Infinity
*
* @example
* var v = tand( NaN );
* // returns NaN
*/
declare function tand( x: number ): number;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'use strict';

/**
* Evaluate the tangent of a degree.
* Compute the tangent of an angle measured in degrees.
*
* @module @stdlib/math/base/special/tand
*
Expand Down
18 changes: 9 additions & 9 deletions lib/node_modules/@stdlib/math/base/special/tand/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
// MODULES //

var tan = require( '@stdlib/math/base/special/tan' );
var isInteger = require('@stdlib/math/base/assert/is-integer');
var deg2rad = require('@stdlib/math/base/special/deg2rad');
var isInteger = require( '@stdlib/math/base/assert/is-integer' );
var deg2rad = require( '@stdlib/math/base/special/deg2rad' );


// MAIN //

/**
* Evaluates the tangent of a degree.
* Computes the tangent of an angle measured in degrees.
*
* @param {number} x - input value (in degree)
* @param {number} x - input value (in degrees)
* @returns {number} tangent
*
* @example
Expand All @@ -52,21 +52,21 @@ var deg2rad = require('@stdlib/math/base/special/deg2rad');
function tand( x ) {
var xRad;

if (x === Infinity || x === -Infinity) {
if ( x === Infinity || x === -Infinity ) {
return NaN;
}

if (isInteger(((x / 90) - 1) / 2)) {
if ( isInteger( ( ( x / 90 ) - 1 ) / 2 )) {
return Infinity;
}

if (isInteger((x / 90) / 2)) {
if ( isInteger( ( x / 90 ) / 2) ) {
return 0;
}

xRad = deg2rad(x);
xRad = deg2rad( x );

return tan(xRad);
return tan( xRad );
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stdlib/math/base/special/tand",
"version": "0.0.0",
"description": "Evaluate the tangent of a degree.",
"description": "Computes the tangent of an angle measured in degrees",
"license": "Apache-2.0",
"author": {
"name": "The Stdlib Authors",
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/math/base/special/tand/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ tape( 'main export is a function', function test( t ) {
t.end();
});

tape( 'the function computes the tangent (negative values)', function test( t ) {
tape( 'the function computes the tangent of an angle measured in degrees (negative values)', function test( t ) {
var expected;
var delta;
var tol;
Expand All @@ -67,7 +67,7 @@ tape( 'the function computes the tangent (negative values)', function test( t )
t.end();
});

tape( 'the function computes the tangent (positive values)', function test( t ) {
tape( 'the function computes the tangent of an angle measured in degrees (positive values)', function test( t ) {
var expected;
var delta;
var tol;
Expand Down

0 comments on commit 2e030f2

Please sign in to comment.