Skip to content

Commit 3381152

Browse files
committed
Refactor in accordance with pull request comments
1 parent aee020e commit 3381152

File tree

3 files changed

+96
-23
lines changed

3 files changed

+96
-23
lines changed

lib/node_modules/@stdlib/math/base/special/cosc/README.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
@license Apache-2.0
44
5-
Copyright (c) 2018 The Stdlib Authors.
5+
Copyright (c) 2019 The Stdlib Authors.
66
77
Licensed under the Apache License, Version 2.0 (the "License");
88
you may not use this file except in compliance with the License.
@@ -24,10 +24,16 @@ limitations under the License.
2424
2525
<section class="intro">
2626

27-
The derivative of the normalized [cardinal sine][sinc] function is defined as
27+
The derivative of the normalized [cardinal sine][sinc] is defined as
2828

29-
` { cosc(x) = (cos( PI*x ) - sin( PI*x )/(PI*x)) / x } if x != 0, and 0 if x == 0 `
29+
<!-- <equation class="equation" label="eq:cosc" align="center" raw=""\operatorname{cosc}(x) = \begin{cases} \frac{\cos(\pi x)}{x} - \frac{\sin( \pi x)}{\pi x^2} & \textrm{if}\ x \neq 0 \\ 0 & \textrm{if}\ x = 0\end{cases}" alt="Derivative of the normalized cardinal sine."> -->
3030

31+
<div class="equation" align="center" data-raw-text="\operatorname{cosc}(x) = \begin{cases} \frac{\cos(\pi x)}{x} - \frac{\sin( \pi x)}{\pi x^2} &amp; \textrm{if}\ x \neq 0 \\ 0 &amp; \textrm{if}\ x = 0\end{cases}" data-equation="eq:cosc">
32+
<img src="docs/img/equation_cosc_function.svg" alt="Derivative of the normalized cardinal sine.">
33+
<br>
34+
</div>
35+
36+
<!-- </equation> -->
3137

3238
<!-- </equation> -->
3339

@@ -42,29 +48,25 @@ for any real number `x`.
4248
## Usage
4349

4450
```javascript
45-
var cosc = require( '@stdlib/math/base/special/cosc' );
51+
var cosc = require("@stdlib/math/base/special/cosc");
4652
```
4753

4854
#### cosc( x )
4955

5056
Computes the derivative of the normalized [cardinal sine][sinc] of a `number`.
5157

5258
```javascript
53-
var v = cosc( 0.5 );
54-
55-
// Return ~-1.273
56-
57-
var x = cosc( -1.2 );
58-
59-
// Return ~0.544
60-
61-
var y = cosc( 0.0 );
59+
var v = cosc(0.5);
60+
// returns ~-1.273
6261

63-
// Return 0
62+
v = cosc(-1.2);
63+
// returns ~0.544
6464

65-
var z = cosc( NaN );
65+
v = cosc(0.0);
66+
// returns 0
6667

67-
// Return NaN
68+
v = cosc(NaN);
69+
// returns NaN
6870
```
6971

7072
</section>
@@ -78,14 +80,14 @@ var z = cosc( NaN );
7880
<!-- eslint no-undef: "error" -->
7981

8082
```javascript
81-
var linspace = require( '@stdlib/math/utils/linspace' );
82-
var cosc = require( '@stdlib/math/base/special/cosc' );
83+
var linspace = require("@stdlib/math/utils/linspace");
84+
var cosc = require("@stdlib/math/base/special/cosc");
8385

84-
var x = linspace( -5.0, 5.0, 100 );
86+
var x = linspace(-5.0, 5.0, 100);
8587
var i;
8688

87-
for ( i = 0; i < x.length; i++ ) {
88-
console.log( cosc( x[ i ] ) );
89+
for (i = 0; i < x.length; i++) {
90+
console.log(cosc(x[i]));
8991
}
9092
```
9193

0 commit comments

Comments
 (0)