projects
/
my-code
/
triang.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f2ec381
)
changed to global variables instead of pointers
author
hackbard
<hackbard>
Fri, 9 Aug 2002 00:22:38 +0000
(
00:22
+0000)
committer
hackbard
<hackbard>
Fri, 9 Aug 2002 00:22:38 +0000
(
00:22
+0000)
triang.c
patch
|
blob
|
history
diff --git
a/triang.c
b/triang.c
index
ca5207a
..
d2d5f9f
100644
(file)
--- a/
triang.c
+++ b/
triang.c
@@
-1,9
+1,10
@@
#include <stdio.h>
#include <math.h>
#include <stdio.h>
#include <math.h>
+
#define MAXSIGNAL 100
#define MAXSIGNAL 100
-double
*delta1, *
delta2;
+double
delta1,
delta2;
/*
zweite Loesung ist achsensymmetrisch zur Verbindungslinie
/*
zweite Loesung ist achsensymmetrisch zur Verbindungslinie
@@
-17,24
+18,22
@@
void seek_target (float X1, float Y1, float X2, float Y2, int E1, int E2) {
/* E1 eigene Signalstaerke vom target */
/* E2 Signalstaerke des Targets vom Freund */
/* E1 eigene Signalstaerke vom target */
/* E2 Signalstaerke des Targets vom Freund */
-// printf("Debug: %f %f %f %f %d %d \n", X1, Y1, X2, Y2, E1, E2);
-
double zaehler, nenner, zusatz;
double zaehler, nenner, zusatz;
-zaehler=MAXSIGNAL*(1./E1-1./E2)-(X1-X2)*(X1-X2)-(Y1-Y2)*(Y1-Y2);
+printf("Debug: %f %f %f %f %d %d \n", X1, Y1, X2, Y2, E1, E2);
+
+zaehler=MAXSIGNAL*(1./E2-1./E1)-(X1-X2)*(X1-X2)-(Y1-Y2)*(Y1-Y2);
nenner=2*sqrt((X1-X2)*(X1-X2)+(Y1-Y2)*(Y1-Y2));
zusatz=sqrt((double)MAXSIGNAL/E1);
nenner=2*sqrt((X1-X2)*(X1-X2)+(Y1-Y2)*(Y1-Y2));
zusatz=sqrt((double)MAXSIGNAL/E1);
-
*
delta1=zusatz*sin(acos(zaehler/(nenner*zusatz)));
-
*
delta2=zaehler/nenner;
+delta1=zusatz*sin(acos(zaehler/(nenner*zusatz)));
+delta2=zaehler/nenner;
}
main() {
/* beispiel */
}
main() {
/* beispiel */
-printf("Debug: funzt noch ...\n");
-
float a, b, c, d;
int e, f;
float a, b, c, d;
int e, f;
@@
-43,15
+42,15
@@
b=0;
c=0;
d=10;
e=90;
c=0;
d=10;
e=90;
-f=
35
;
+f=
90
;
seek_target (a, b, c, d, e, f);
/* wir sind im ursprung, kumpel 10 einheiten ueber uns! */
printf("Debug: seek_target ausgefuehrt!\n");
seek_target (a, b, c, d, e, f);
/* wir sind im ursprung, kumpel 10 einheiten ueber uns! */
printf("Debug: seek_target ausgefuehrt!\n");
-printf("1. Moeglichkeit: (%f;%f)\n",
*delta1, *
delta2);
-printf("2. Moeglichkeit: (%f;%f)\n",
*delta2, *
delta1);
+printf("1. Moeglichkeit: (%f;%f)\n",
delta1,
delta2);
+printf("2. Moeglichkeit: (%f;%f)\n",
delta2,
delta1);
}
}