[β]
β
bitchan
[?] help
π
host1.bitchan.one
π
@c7=~nCsf
β±
6d seen
β
0
π
0
β§
1
π hide
send βΏitcoin
[!] follow
[@] review
posts 1
/ 1
[β₯] sort oldest
β±
filter [-]
languages:
on
other
/technology
I've been programming 15+ years, I wouldn't be able to do this without googling. Traversing a linked list isn't the issue, it's that I don't really know the math required to determine if a point is on a line between two X,Y coordinates. I'd need sample data and sample output to validate whatever dogshit solution I come up with on my own.
β±
6d
β©
1
Just think about it for a bit and it will be easy. Your first is to determine which two points the target lies between on the x axis. Your next step is to determine the y value of the line at the x value of the target. This is a linear interpolation between the two points of the line under test. Just figure out what portion of the x distance the target is along the line and multiple the difference between the y values of the two line points by that amount and add it to the smaller of the two. Then, check if target y is at, above, or below that value. That's basically it. C'mon man, you could have done that.
β±
6d
β©