Skip to content

Commit 247b859

Browse files
committed
docs: add documentation
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent fe46577 commit 247b859

File tree

2 files changed

+213
-0
lines changed

2 files changed

+213
-0
lines changed
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2025 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+
# sind
22+
23+
> Computes the [sine][trigonometric-functions] of an angle measured in degrees.
24+
25+
<section class="intro">
26+
27+
</section>
28+
29+
<section class="usage">
30+
31+
## Usage
32+
33+
```javascript
34+
var sind = require( '@stdlib/math/base/special/sind' );
35+
```
36+
37+
#### sind( x )
38+
39+
Computes the [sine][trigonometric-functions] of `x` (in degrees).
40+
41+
```javascript
42+
var v = sind( 0.0 );
43+
// returns 0.0
44+
45+
v = sind( 30.0 );
46+
// returns ~0.5
47+
48+
v = sind( 90.0 );
49+
// returns 1.0
50+
51+
v = sind( NaN );
52+
// returns NaN
53+
```
54+
55+
</section>
56+
57+
<!-- /.usage -->
58+
59+
<section class="examples">
60+
61+
## Examples
62+
63+
<!-- eslint no-undef: "error" -->
64+
65+
```javascript
66+
var linspace = require( '@stdlib/array/base/linspace' );
67+
var sind = require( '@stdlib/math/base/special/sind' );
68+
69+
var x = linspace( -180, 180, 100 );
70+
71+
var i;
72+
for ( i = 0; i < x.length; i++ ) {
73+
console.log( sind( x[ i ] ) );
74+
}
75+
```
76+
77+
</section>
78+
79+
<!-- /.examples -->
80+
81+
<!-- C interface documentation. -->
82+
83+
* * *
84+
85+
<section class="c">
86+
87+
## C APIs
88+
89+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
90+
91+
<section class="intro">
92+
93+
</section>
94+
95+
<!-- /.intro -->
96+
97+
<!-- C usage documentation. -->
98+
99+
<section class="usage">
100+
101+
### Usage
102+
103+
```c
104+
#include "stdlib/math/base/special/sind.h"
105+
```
106+
107+
#### stdlib_base_sind( x )
108+
109+
Computes the [sine][trigonometric-functions] of `x` (in degrees).
110+
111+
```c
112+
double out = stdlib_base_sind( 0.0 );
113+
// returns 0.0
114+
115+
out = stdlib_base_sind( 30.0 );
116+
// returns ~0.5
117+
```
118+
119+
The function accepts the following arguments:
120+
121+
- **x**: `[in] double` input value.
122+
123+
```c
124+
double stdlib_base_sind( const double x );
125+
```
126+
127+
</section>
128+
129+
<!-- /.usage -->
130+
131+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
132+
133+
<section class="notes">
134+
135+
</section>
136+
137+
<!-- /.notes -->
138+
139+
<!-- C API usage examples. -->
140+
141+
<section class="examples">
142+
143+
### Examples
144+
145+
```c
146+
#include "stdlib/math/base/special/sind.h"
147+
#include <stdio.h>
148+
149+
int main( void ) {
150+
const double x[] = { 0.0, 30.0, 45.0, 60.0, 90.0 };
151+
152+
double y;
153+
int i;
154+
for ( i = 0; i < 5; i++ ) {
155+
y = stdlib_base_sind( x[ i ] );
156+
printf( "sind(%lf) = %lf\n", x[ i ], y );
157+
}
158+
}
159+
```
160+
161+
</section>
162+
163+
<!-- /.examples -->
164+
165+
</section>
166+
167+
<!-- /.c -->
168+
169+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
170+
171+
<section class="related">
172+
173+
</section>
174+
175+
<!-- /.related -->
176+
177+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
178+
179+
<section class="links">
180+
181+
[trigonometric-functions]: https://en.wikipedia.org/wiki/Trigonometric_functions
182+
183+
</section>
184+
185+
<!-- /.links -->
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
{{alias}}( x )
3+
Computes the sine of an angle measured in degrees.
4+
5+
Parameters
6+
----------
7+
x: number
8+
Input value (in degrees).
9+
10+
Returns
11+
-------
12+
y: number
13+
Sine.
14+
15+
Examples
16+
--------
17+
> var y = {{alias}}( 0.0 )
18+
0.0
19+
> y = {{alias}}( 90.0 )
20+
1.0
21+
> y = {{alias}}( 30.0 )
22+
~0.5
23+
> y = {{alias}}( NaN )
24+
NaN
25+
26+
See Also
27+
--------
28+

0 commit comments

Comments
 (0)