~ubuntu-branches/ubuntu/maverick/yagiuda/maverick

« back to all changes in this revision

Viewing changes to src/z_input.c

  • Committer: Bazaar Package Importer
  • Author(s): Joop Stakenborg
  • Date: 2005-08-22 20:20:13 UTC
  • Revision ID: james.westby@ubuntu.com-20050822202013-mhhxp4xirdxrdfx1
Tags: upstream-1.19
ImportĀ upstreamĀ versionĀ 1.19

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifdef HAVE_STDLIB_H
 
2
#include <stdlib.h>
 
3
#endif
 
4
#include <stdio.h>
 
5
#include <math.h>
 
6
#include <errno.h>
 
7
#include "yagi.h"
 
8
extern int errno;
 
9
 
 
10
/* compute the input impedance (driving impedance) */
 
11
 
 
12
void z_input(struct FCOMPLEX v, struct FCOMPLEX i, struct FCOMPLEX *impedance)
 
13
{
 
14
        *impedance=Cdiv(v,i);
 
15
       /* printf("Voltage=%f + i %f\n", v.r, v.i);
 
16
        printf("Current = %f + i %f \n", i.r, i.i); 
 
17
        printf("Z = V/I = %f + %f \n", impedance->r, impedance->i); */
 
18
 
 
19
#ifdef DEBUG
 
20
        if(errno)
 
21
        {
 
22
                fprintf(stderr,"Errno =%d in z_input() in z_input.c\n", errno);
 
23
                exit(1);
 
24
        }
 
25
#endif
 
26
}
 
27