My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
vector2d  
enables vector based calculations.
Updated Apr 17, 2012 by wiebo.de.wit

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.


Sign in to add a comment
Powered by Google Project Hosting