MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / c_tan

Method c_tan

libraries/Complex/complex.cpp:208–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206
207
208Complex Complex::c_tan() const
209{
210 /* faster but 350 bytes longer!!
211 float s = sin(re);
212 float c = cos(re);
213 float sh = sinh(im);
214 float ch = cosh(im);
215 // return Complex(s*ch, c*sh) / Complex(c*ch, -s*sh);
216 float r0 = s*ch;
217 float i0 = c*sh;
218 float cre = c*ch;
219 float cim = -s*sh;
220 float f = 1.0/(cre*cre + cim*cim);
221 float r = r0 * cre + i0 * cim;
222 float i = r0 * cim - i0 * cre;
223 return Complex(r * f, -i * f);
224 */
225 return c_sin() / c_cos();
226}
227
228
229Complex Complex::gonioHelper1(const byte mode) const

Callers 1

unittestFunction · 0.80

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.64