ComplexNum(Real, Imaginary)
Last updated November 15, 2001
Version: 1 | Requires: ColdFusion 5 | Library: MathLib
Description:
This function simply builds a structure representing a complex number. This is a useful format to enable working with complex numbers.
Return Values:
Returns a structure representing a complex number with the keys R and I.
Example:
<cfdump var="#c#">
Parameters:
| Name | Description | Required |
|---|---|---|
| Real | Real part of the complex number. | Yes |
| Imaginary | Imaginary part of the complex number. | Yes |
Full UDF Source:
<cfscript>
/**
* Create a complex number as a structure.
*
* @param Real Real part of the complex number.
* @param Imaginary Imaginary part of the complex number.
* @return Returns a structure representing a complex number with the keys R and I.
* @author Matthew Walker (matthew@electricsheep.co.nz)
* @version 1, November 15, 2001
*/
function ComplexNum(Real,Imaginary) {
var ComplexNumber = StructNew();
ComplexNumber.R=Real;
ComplexNumber.I=Imaginary;
return ComplexNumber;
}
</cfscript>
Search CFLib.org
Latest Additions
Dave Anderson added
iniToStruct
20 day(s) ago
Dave Anderson added
deDupeArray
20 day(s) ago
Richard added
dice
22 day(s) ago
Isaac Dealey added
getRelative
a while ago
Top Rated
backupDatabase
Rated 5.0, 22 time(s)
indentXml
Rated 5.0, 10 time(s)
generateSsccAsn
Rated 5.0, 4 time(s)
highlightAndCrop
Rated 5.0, 4 time(s)