[Mathlib-commitlog] mathlib/Source/MathLib/Functions/Matrix exp.java, NONE, 1.1
Status: Beta
Brought to you by:
st_mueller
|
From: Stefan M. <st_...@us...> - 2007-01-12 21:38:46
|
Update of /cvsroot/mathlib/mathlib/Source/MathLib/Functions/Matrix In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28873/Source/MathLib/Functions/Matrix Added Files: exp.java Log Message: --- NEW FILE: exp.java --- package MathLib.Functions.Matrix; import MathLib.Functions.ExternalElementWiseFunction; public class exp extends ExternalElementWiseFunction { public exp() { name = "exp"; } /**Calculates the exponent of a complex number @param arg = the value as an array of double @return the result as an array of double*/ public double[] evaluateValue(double[] arg) { double[] result = new double[2]; double scalar = Math.exp(arg[REAL]); // e^ix = cis x result[REAL] = scalar * Math.cos(arg[IMAG]); result[IMAG] = scalar * Math.sin(arg[IMAG]); return result; } } /* @GROUP general @SYNTAX exp(value) @DOC . @EXAMPLES exp(-5.5) = -5 exp(2.3) = 3 @SEE log, ln */ |