pointvec/sources/scripts/pos.js
Devine Lu Linvega 0db55f4ba4 Version 1?
2017-11-05 17:33:04 +13:00

20 lines
287 B
JavaScript

function Pos(x,y)
{
this.x = x;
this.y = y;
this.toString = function()
{
return x+","+y;
}
this.sub = function(pos2)
{
return new Pos(this.x - pos2.x,this.y - pos2.y)
}
this.is_equal = function(pos2)
{
return pos2.x == this.x && pos2.y == this.y;
}
}