~ubuntu-branches/ubuntu/precise/yagiuda/precise

« back to all changes in this revision

Viewing changes to .pc/debian-changes-1.19-6.2/src/sens.c

  • Committer: Bazaar Package Importer
  • Author(s): Ralf Treinen
  • Date: 2010-08-25 22:19:13 UTC
  • Revision ID: james.westby@ubuntu.com-20100825221913-lgc7yuj3f7nqugpm
Tags: 1.19-7
* QA upload
* Source format 3.0 (quilt)
* patch optopt-declaration: fix declaration of optopt (closes: 593486).
  Thanks a lot to Jakub Wilk <jwilk@debian.org> for the patch!

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifdef HAVE_STDLIB_H
 
2
#include <stdlib.h>
 
3
#endif
 
4
/* file sens.c */
 
5
 
 
6
#include <stdio.h>
 
7
#include <math.h>
 
8
 
 
9
#include <errno.h>
 
10
#include "yagi.h"
 
11
 
 
12
extern int errno;
 
13
extern double boom_factor;
 
14
 
 
15
void sensitivity(double boom_sd, double length_sd, double **driven_data, double**parasitic_data, int driven, int parasites)
 
16
{
 
17
        int i;
 
18
        double x,y;
 
19
        /* data in 2D arrays is in m. User enters SD in mm, hence *0.001 */
 
20
 
 
21
        
 
22
        /* adjust director length only. Keep at x=0 */
 
23
 
 
24
        x=parasitic_data[1][LENGTH];
 
25
        parasitic_data[1][LENGTH]+=length_sd*0.001*gaussian();
 
26
        y=parasitic_data[1][LENGTH];
 
27
        /* Adjust other parasites */
 
28
        for(i=2;i<=parasites;++i)
 
29
        {
 
30
                parasitic_data[i][X]+=boom_sd*0.001*gaussian();
 
31
                parasitic_data[i][LENGTH]+=length_sd*0.001*gaussian();
 
32
        }
 
33
        for(i=1; i<=driven; ++i)
 
34
        {
 
35
                driven_data[i][X]+=boom_sd*0.001*gaussian();
 
36
                driven_data[i][LENGTH]+=length_sd*0.001*gaussian();
 
37
        }
 
38
 
 
39
#ifdef DEBUG
 
40
        if(errno)
 
41
        {
 
42
                fprintf(stderr,"Errno =%d in sens.c\n", errno);
 
43
                exit(1);
 
44
        }
 
45
#endif
 
46
 
 
47
}
 
48