While GameMaker is a fantastic game creation tool, it is missing a large amount of basic mathematical functions. Most of this being the lack of proper vectors.
The UBG Math extension simply tries to fill this gap by adding numerous vector functions as well as some severely needed matrix functions. The supported vector types are vector2, vector3, vector4 and quaternions.
With this extension you can perform you basic vector math such as cross products, dot products, and normalization. Also included are game-related functions such as calculating a "bounce" vector, projecting a vector onto a plane for slide collisions, rotating vectors around eachother or by angles, lerp, slerp, nlerp, and more.
Vector data structures are handled just like matrices. They are simply arrays with a set number of elements inside of them. You can create a vector simply by creating an array. You can also convert between vector types and check if a value is a vector with the system scripts.
As an example, let's say we want to make a transformation matrix from a vector / quaternion pair, transform a vector by it, then output the result. It could look something like this: