1 /*$Id: m_phase.h,v 26.118 2009/08/22 21:08:57 al Exp $ -*- C++ -*-
2 * Copyright (C) 2008 Albert Davis
3 * Author: Albert Davis <aldavis@gnu.org>
5 * This file is part of "Gnucap", the Gnu Circuit Analysis Package
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3, or (at your option)
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 //testing=script 2008.06.06
27 /*--------------------------------------------------------------------------*/
28 /* phase: extract phase (degrees) from COMPLEX number
29 * rotates 90 degrees! (ref to sine instead of cosine)
31 inline double phase(COMPLEX x
)
33 double rv
= NOT_VALID
;
38 case pP_DEGREES
:untested();
40 if (rv
< 0) {untested();
45 case pN_DEGREES
:itested();
47 if (rv
> 0) {itested();
58 /*--------------------------------------------------------------------------*/
59 /*--------------------------------------------------------------------------*/
61 // vim:ts=8:sw=2:noet: