Thanks to visit codestin.com
Credit goes to lib.haxe.org

hx-vector2d

Vector2d / Point class for Haxe. With operator overloading.
https://github.com/markknol/hx-vector2d/

To install, run:

haxelib install hx-vector2d 0.0.2 

See using Haxelib in Haxelib documentation for more information.

README.md

hx-vector2d

Worlds most complete Vector2d / Point class for Haxe. With operator overloading.

var p1:Vector2d = new Vector2d(10, 20);
var p2:Vector2d = {x: 10.0, y: 30.0};

// same as `var p3 = p1.add(p2);`, same as `var p3 = {x: p1.x + p2.x, y:p1.y + p2.y}`
var p3 = p1 + p2; 
trace(p3); // p3 = {x: 20.0, y: 50.0}

// x*x + y*y
trace(p3.length); // 2900

// same as Math.sqrt(p3.length)
trace(p3.magnitude); // 53.85164807134504

Dependencies

Contributors
markknol
Version
0.0.2
Published
7 years ago
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub