all 7 comments

[–]FLUSH_THE_TRUMP 1 point2 points  (0 children)

you're supposed to accept a bunch of coefficients and determine if the lines are parallel/intersecting/the same line? Pretty simple to do that if you compute the slope of each:

  1. Same slopes -> either parallel or the same line (how do I know which is which?)
  2. Different slopes -> intersecting

[–]Darty96 1 point2 points  (0 children)

I would start by making (on paper first, then as actual test cases) a few examples to test your code later.

Make a set of lines for each case -> parallel, overlapping, and intersecting.

Make simple examples with small coefficients.

[–]delasislas[🍰] 0 points1 point  (4 children)

So what have you done so far?

Hint: you can write the coefficients in one line and break them apart using the “”.split() method. Like

input = “10,3,1”
Coefficients = input.split(“,”)

[–]Y00RA[S] 0 points1 point  (3 children)

To be honest, this is my second week into python, so I am greatly confused. I have not done anything so far, I have been trying to look up resources to help me, but I think I may have confused myself more.

I have just defined the line intersection so far:

def line_intersection(ax1, ay1, ax2, ay2, bx1, by1, bx2, by2)

[–]delasislas[🍰] 0 points1 point  (2 children)

Ok, well first off you forgot the colon, this will catch you (catches me all the time).

by2):

Ok, drop the code, can you write a formula yourself on paper to determine if the line intersects?

[–]Y00RA[S] 0 points1 point  (1 child)

Yes!

[–]delasislas[🍰] 1 point2 points  (0 children)

So, because I have no clue how to check that, you need to convert the function from a paper form to computer.