5,7 → 5,7 |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; |
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License and GNU Lesser General Public License for more details. |
You should have received a copy of GNU General Public License ((License_GPL.txt) and |
You should have received a copy of GNU General Public License (License_GPL.txt) and |
GNU Lesser General Public License (License_LGPL.txt) along with this program. |
If not, see <http://www.gnu.org/licenses/>. |
|
15,7 → 15,7 |
Peter Muehlenbrock |
Winkelfunktionen sin, cos und arctan in |
brute-force Art: Sehr Schnell, nicht sonderlich genau, aber ausreichend |
Sinus Funktion von Nick666 vereinfacht |
get_dist Funktion fuer Entfernungsermittlung |
Stand 1.10.2007 |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
*/ |
42,7 → 42,7 |
|
// Wert durch lineare Interpolation ermitteln |
if ((y == 0) && (x == 0)) wert =1; // Division durch 0 nicht erlaubt |
else wert= abs((x*1000)/y); |
else wert= abs(((long) x*1000)/((long)y)); |
|
if (wert <=268) //0...0.0,268 entsprechend 0..15 Grad |
{ |
108,7 → 108,7 |
} |
|
// Aus x,y und Winkel Distanz ermitteln |
long get_dist(signed int x, signed int y, signed int phi) |
int get_dist(signed int x, signed int y, signed int phi) |
{ |
long dist; |
if (abs(x) > abs(y) ) |
121,6 → 121,6 |
dist = (long) y; |
dist = abs((dist *1000) / (long) cos_i(phi)); |
} |
return dist; |
return (int)dist; |
} |
|