vector2d.mod
Repo location
Vector2D is a vector class to simplify vector math and calculations. It is also used by some of my other modules.
How to use
Put the module source in the module folder. The path should look like blitzmax\mod\wdw\vector2d.mod\
Code Example
What follows is an example that shows some basic calculations:
First, import the module:
Import wdw.vector2d
Then, we perform some simple math just to give you an idea:
Local v:TVector2D = New TVector2D
v.Set(10,10)
v.Add(5, 5)
Local v2:TVector2D = New TVector2D
v2.Set(20,30)
v.AddV(v2)
Print v.GetX() + "," + v.GetY()
This example prints 35,45.