-
-
Notifications
You must be signed in to change notification settings - Fork 448
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
459 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
lib/node_modules/@stdlib/math/base/special/cpolar/lib/assign.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* @license Apache-2.0 | ||
* | ||
* Copyright (c) 2023 The Stdlib Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
// MODULES // | ||
|
||
var cabs = require( '@stdlib/math/base/special/cabs' ); | ||
var cphase = require( '@stdlib/math/base/special/cphase' ); | ||
|
||
|
||
// MAIN // | ||
|
||
/** | ||
* Computes the absolute value and the phase of a double-precision complex floating-point number. | ||
* | ||
* @private | ||
* @param {Complex128} z - complex number | ||
* @param {Collection} out - output array | ||
* @param {integer} stride - output array stride | ||
* @param {NonNegativeInteger} offset - output array index offset | ||
* @returns {Collection} absolute value and phase (in radians) | ||
* | ||
* @example | ||
* var Complex128 = require( '@stdlib/complex/float64' ); | ||
* | ||
* var o = cpolar( new Complex128( 5.0, 3.0 ), [ 0.0, 0.0 ], 1, 0 ); | ||
* // returns [ ~5.83, ~0.5404 ] | ||
*/ | ||
function cpolar( z, out, stride, offset ) { | ||
out[ offset ] = cabs( z ); | ||
out[ offset+stride ] = cphase( z ); | ||
return out; | ||
} | ||
|
||
|
||
// EXPORTS // | ||
|
||
module.exports = cpolar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.