Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function pointOfSegment(input) {
- let first = Number(input[0]);
- let second = Number(input[1]);
- let point = Number(input[2]);
- console.log(point <= first && point >= second || point >= first && point <= second ? "in" : "out");
- console.log(Math.min(Math.abs(first - point), Math.abs(second - point)));
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement