Literally just click. Does Grade 8 math for you! Click to create 4 different points. The first two points will create the first line, and the second pair will create the second line. The incredible program will then find the intersection (if any) of the two lines. Variables on the side are used in calculating stuff. If you want to use this in any of your projects, just drop the "Code" sprite into your backpack! Make sure to give credit too! Features: Uses (hopefully) comprehensive point inputs, includes vertical line intersection capabilities, and even includes a parallel line detector! How to use the code: l1x1 is the x part of the first point of the first line. Similarly, l1y1 is the y part of the first point of the first line. Each line requires two points, so there is also l1x2 and l1y2. Two lines are required, so l2x1 etc. are also real variables. "int. x" and "int. y" create the calculated intersection point. If you find any bugs/glitches, or just have a question, ask me about it in the comments! Note: If the bug you are about to tell me about is that you can't see the red dot, check the int. x and int. y variables! If either of those are more or less than the screen width or height (480x360) respectively, then the intersection is simply off screen. Also, if the "parallel" variable is 1, the other outputs are invalid.
Mostly made this to help with a third triangle filler I'm working on, but decided that it was interesting/helpful enough to share as a project itself. Funny story: While making this, I spent like 2 hours staring at the popular line equation of y = mx + b, trying to get both x and y on one side of the equation and m and b on the other. After the two hours of unsuccessfulness, I looked at an example I'd created for myself at the start, and figured out the math stuff to find intersections in about 5 minutes. This made me feel dum, and I guess it just goes to show that sometimes you need to look at things from a different angle. Ha ha! Get it? Angle? Intersecting lines and stuff? Ha ha ha! I'm so funny! Ha ha! Ok, fine it's not funny.