<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.svencoop.com/index.php?action=history&amp;feed=atom&amp;title=CMath</id>
	<title>CMath - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.svencoop.com/index.php?action=history&amp;feed=atom&amp;title=CMath"/>
	<link rel="alternate" type="text/html" href="https://wiki.svencoop.com/index.php?title=CMath&amp;action=history"/>
	<updated>2026-04-04T08:54:57Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://wiki.svencoop.com/index.php?title=CMath&amp;diff=1198&amp;oldid=prev</id>
		<title>Outerbeast at 19:53, 13 March 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.svencoop.com/index.php?title=CMath&amp;diff=1198&amp;oldid=prev"/>
		<updated>2025-03-13T19:53:12Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://wiki.svencoop.com/index.php?title=CMath&amp;amp;diff=1198&amp;amp;oldid=1194&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Outerbeast</name></author>
	</entry>
	<entry>
		<id>https://wiki.svencoop.com/index.php?title=CMath&amp;diff=1194&amp;oldid=prev</id>
		<title>Outerbeast: Created page with &quot;This class contains math operation methods. A single global instance exists: &lt;code&gt;CMath Math&lt;/code&gt;  The AngelScript standard library also contains math functions such as tri...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.svencoop.com/index.php?title=CMath&amp;diff=1194&amp;oldid=prev"/>
		<updated>2025-03-09T19:22:33Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;This class contains math operation methods. A single global instance exists: &amp;lt;code&amp;gt;CMath Math&amp;lt;/code&amp;gt;  The AngelScript standard library also contains math functions such as tri...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This class contains math operation methods.&lt;br /&gt;
A single global instance exists: &amp;lt;code&amp;gt;CMath Math&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The AngelScript standard library also contains math functions such as trigonometric, exponential, logarithmic and others. They can be found [https://www.angelcode.com/angelscript/sdk/docs/manual/doc_addon_math.html here].&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold; text-align:center; vertical-align:middle;&amp;quot;&lt;br /&gt;
! Declaration&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| int32 RandomLong(int32 low, int32 high)&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Returns a random integer between low and high&lt;br /&gt;
|-&lt;br /&gt;
| float RandomFloat(float low, float high)&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Returns a random float between low and high&lt;br /&gt;
|-&lt;br /&gt;
| void MakeVectors(const Vector&amp;amp; in vecAngles)&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Makes vectors&lt;br /&gt;
|-&lt;br /&gt;
| Vector RotateVector(Vector&amp;amp; in vecToRotate,const Vector&amp;amp; in vecAngles, const Vector&amp;amp; in vecOffset)&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Rotate vector&lt;br /&gt;
|-&lt;br /&gt;
| void MakeAimVectors(const Vector&amp;amp; in vecAngles)&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Make aim vectors&lt;br /&gt;
|-&lt;br /&gt;
| void MakeInvVectors(const Vector&amp;amp; in vecAngles)&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Make inverted vectors&lt;br /&gt;
|-&lt;br /&gt;
| float VecToYaw(const Vector&amp;amp; in vec)&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Transforms a vector to a yaw value&lt;br /&gt;
|-&lt;br /&gt;
| Vector VecToAngles(const Vector&amp;amp; in vec)&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Transforms a vector to an angle&lt;br /&gt;
|-&lt;br /&gt;
| float AngleMod(float flAngle)&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Clamps the given angle between 0 and 360&lt;br /&gt;
|-&lt;br /&gt;
| float AngleDiff(float flDestAngle, float flSrcAngle)&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Returns the difference between 2 angles&lt;br /&gt;
|-&lt;br /&gt;
| float ApproachAngle(float target, float value, float speed)&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Given a target and current angle value, and a rotation speed, all in degrees, returns a new angle that is either between value and target, or target, depending on whether the speed is high enough to reach that angle.&lt;br /&gt;
|-&lt;br /&gt;
| float AngleDistance(float flNext, float flCur)&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Returns the distance between 2 angles&lt;br /&gt;
|-&lt;br /&gt;
| uint64 min(uint64 lhs, uint64 rhs) const&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Returns the smaller of the two values&lt;br /&gt;
|-&lt;br /&gt;
| int64 min(int64 lhs, int64 rhs) const&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Returns the smaller of the two values&lt;br /&gt;
|-&lt;br /&gt;
| float min(float lhs, float rhs) const&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Returns the smaller of the two values&lt;br /&gt;
|-&lt;br /&gt;
| uint64 max(uint64 lhs, uint64 rhs) const&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Returns the larger of the two values&lt;br /&gt;
|-&lt;br /&gt;
| int64 max(int64 lhs, int64 rhs) const&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Returns the larger of the two values&lt;br /&gt;
|-&lt;br /&gt;
| float max(float lhs, float rhs) const&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Returns the larger of the two values&lt;br /&gt;
|-&lt;br /&gt;
| int clamp(int min, int max, int value) const&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Clamps a value between a range&lt;br /&gt;
|-&lt;br /&gt;
| float clamp(float min, float max, float value) const&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Clamps a value between a range&lt;br /&gt;
|-&lt;br /&gt;
| float DegreesToRadians(float flDegrees) const&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Returns the given value in degrees as radians&lt;br /&gt;
|-&lt;br /&gt;
| float RadiansToDegrees(float flRadians) const&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Returns the given value in radians as degrees&lt;br /&gt;
|-&lt;br /&gt;
| bool Compare(float flLhs, float flRhs, float flEpsilon) const&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Compares the given floating point variables and returns whether they are equal, considering certain variance (epsilon) between them.&lt;br /&gt;
|-&lt;br /&gt;
| bool Compare(double flLhs, double flRhs, double flEpsilon) const&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Compares the given floating point variables and returns whether they are equal, considering certain variance (epsilon) between them.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold; text-align:center; vertical-align:middle;&amp;quot;&lt;br /&gt;
! Declaration&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| const int8 INT8_MIN&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Int8 minimum value&lt;br /&gt;
|-&lt;br /&gt;
| const int16 INT16_MIN&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Int16 minimum value&lt;br /&gt;
|-&lt;br /&gt;
| const int32 INT32_MIN&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Int32 minimum value&lt;br /&gt;
|-&lt;br /&gt;
| const int64 INT64_MIN&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Int64 minimum value&lt;br /&gt;
|-&lt;br /&gt;
| const int8 INT8_MAX&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Int8 maximum value&lt;br /&gt;
|-&lt;br /&gt;
| const int16 INT16_MAX&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Int16 maximum value&lt;br /&gt;
|-&lt;br /&gt;
| const int32 INT32_MAX&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Int32 maximum value&lt;br /&gt;
|-&lt;br /&gt;
| const int64 INT64_MAX&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Int64 maximum value&lt;br /&gt;
|-&lt;br /&gt;
| const uint8 UINT8_MAX&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Uint8 maximum value&lt;br /&gt;
|-&lt;br /&gt;
| const uint16 UINT16_MAX&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Uint16 maximum value&lt;br /&gt;
|-&lt;br /&gt;
| const uint32 UINT32_MAX&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Uint32 maximum value&lt;br /&gt;
|-&lt;br /&gt;
| const uint64 UINT64_MAX&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Uint64 maximum value&lt;br /&gt;
|-&lt;br /&gt;
| const size_t SIZE_MAX&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Size_t maximum value&lt;br /&gt;
|-&lt;br /&gt;
| const float FLOAT_MIN&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Float minimum positive value&lt;br /&gt;
|-&lt;br /&gt;
| const double DOUBLE_MIN&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Double minimum positive value&lt;br /&gt;
|-&lt;br /&gt;
| const float FLOAT_MAX&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Float maximum positive value&lt;br /&gt;
|-&lt;br /&gt;
| const double DOUBLE_MAX&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | Double maximum positive value&lt;br /&gt;
|-&lt;br /&gt;
| const double PI&lt;br /&gt;
| style=&amp;quot;vertical-align:middle;&amp;quot; | PI&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>Outerbeast</name></author>
	</entry>
</feed>