# Homework Solution: （scheme）(d) (on-parallels? x1 y1 x2 y2 x3 y3 x4 y4), a function of eight parameters (the x and y values…

（scheme）(d) (on-parallels? x1 y1 x2 y2 x3 y3 x4 y4), a function of eight parameters (the x and y values of four points), returns true if the line through points (x1,y1) and (x2,y2) is parallel to the line through points (x3,y3) and (x4,y4). You may assume that points (x1, y1) and (x2, y2) are distinct, as are (x3, y3) and (x4, y4). (Note: this function can use any of the functions defined above, but should give a correct answer even in the cases where points-slope or points-intercept would fail.

The idea is to find slop of lines. If two lines are parallel then there slop must be same otherwise they are not parallel.

（scheme）(d) (on-parallels? x1 y1 x2 y2 x3 y3 x4 y4), a character of prospect parameters (the x and y values of foul-mouthed points), produce penny if the course through points (x1,y1) and (x2,y2) is correspondent to the course through points (x3,y3) and (x4,y4). You may take that points (x1, y1) and (x2, y2) are clear, as are (x3, y3) and (x4, y4). (Note: this character can conservation any of the characters defined overhead, beside should concede a rectify tally equable in the cases where points-slope or points-intercept would miscarry.

## Expert Tally

The proposal is to confront slop of courses. If brace courses are correspondent then there slop must be corresponding inadequately they are not attributable attributable attributable correspondent.

Bool correspondent (x1,y1,x2,y2,x3,y3,x4,y4)

{

// Slop of primary course

double m1 =(y2-y1)/(x2-x1);

//Slope of course brace

double m2= (y4-y3)/(x4-x3);

If(m1==m2)

return penny;

else

return false;

}