Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Point(x, y) {
- function getX() {
- return x;
- }
- function getY() {
- return y;
- }
- function getOriginDistance() {
- return Math.sqrt(getX()**2 + getY()**2);
- }
- return {
- getX: getX,
- getY: getY,
- getOriginDistance: getOriginDistance
- };
- }
Add Comment
Please, Sign In to add comment