Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve ([x1, y1, x2, y2]) {
- console.log(`{${x1}, ${y1}} to {0, 0 is ${Number.isInteger(Math.hypot(x1 - x2, y1 - y2)) ? 'valid' : 'invalid'}`)
- console.log(`{${x2}, ${y2}} to {0, 0 is ${Number.isInteger(Math.hypot(x1 - x2, y1 - y2)) ? 'valid' : 'invalid'}`)
- console.log(`{${x1}, ${y1}} to {${x2}, ${y2} is ${Number.isInteger(Math.hypot(x1 - x2, y1 - y2)) ? 'valid' : 'invalid'}`)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement