Skip to content

Instantly share code, notes, and snippets.

@samleb
Created October 10, 2008 13:49
Show Gist options
  • Save samleb/16045 to your computer and use it in GitHub Desktop.
Save samleb/16045 to your computer and use it in GitHub Desktop.
function Point(x, y) {
return {
getX: K(x),
getY: K(y),
getOriginDistance: function() {
return Math.sqrt(this.getX()**2 + this.getY()**2);
}
}
function Point(x, y) {
return {
getX: K(x),
getY: K(y),
getOriginDistance: function() {
return Math.sqrt(x**2 + y**2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment