Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
mathutil.h
Go to the documentation of this file.
1/*
2** Command & Conquer Generals Zero Hour(tm)
3** Copyright 2025 Electronic Arts Inc.
4**
5** This program is free software: you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation, either version 3 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19//
20// Filename: mathutil.h
21// Project: wwutil
22// Author: Tom Spencer-Smith
23// Date: June 1998
24// Description: static
25//
26//-----------------------------------------------------------------------------
27#if defined(_MSV_VER)
28#pragma once
29#endif
30
31#ifndef MATHUTIL_H
32#define MATHUTIL_H
33
35{
36 public:
37 static void Angle_To_Vector(double angle, double & dx, double & dy);
38 static void Vector_To_Angle(double dx, double dy, double & angle);
39 static double Simple_Distance(double x1, double y1, double x2, double y2);
40 static int Round(double arg);
41 static void Rotate_Vector(double & vx, double & vy, double angle);
42
43 //
44 // Random numbers generated according to simple
45 // Probability Density Functions
46 //
47 static double Get_Uniform_Pdf_Double(double lower, double upper);
49 static int Get_Uniform_Pdf_Int(int lower, int upper);
50 static double Get_Hat_Pdf_Double(double lower, double upper);
51 static double Get_Normalized_Hat_Pdf_Double();
52 static int Get_Hat_Pdf_Int(int lower, int upper);
53
54 static const double PI_1;
55 static const double PI_2;
56};
57
58#endif // MATHUTIL_H
static void Angle_To_Vector(double angle, double &dx, double &dy)
Definition mathutil.cpp:42
static double Get_Normalized_Uniform_Pdf_Double()
Definition mathutil.cpp:158
static void Rotate_Vector(double &vx, double &vy, double angle)
Definition mathutil.cpp:132
static double Simple_Distance(double x1, double y1, double x2, double y2)
Definition mathutil.cpp:110
static double Get_Normalized_Hat_Pdf_Double()
Definition mathutil.cpp:204
static int Get_Uniform_Pdf_Int(int lower, int upper)
Definition mathutil.cpp:164
static const double PI_1
Definition mathutil.h:54
static int Round(double arg)
Definition mathutil.cpp:118
static int Get_Hat_Pdf_Int(int lower, int upper)
Definition mathutil.cpp:210
static double Get_Hat_Pdf_Double(double lower, double upper)
Definition mathutil.cpp:175
static void Vector_To_Angle(double dx, double dy, double &angle)
Definition mathutil.cpp:77
static double Get_Uniform_Pdf_Double(double lower, double upper)
Definition mathutil.cpp:146
static const double PI_2
Definition mathutil.h:55