𓁟 host1.bitchan.one

𓀐 @JPFvTR3A: This is the future you chose.

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.

⧖expiring0/2 kept5d ago

𓀐 @c7=~nCsf

⏱ 5d 👍 0

⬆ upvote 0

[⇥] sort oldest ⏱
filter [-]
𓀐 @gxQacNjL: 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.+

⬆ upvote 0↩ reply 0