Question: ACS Line is a line defined by the equation ar+by+co, where a is not equal to zero, b is not equal to zero, and a,
ACS Line is a line defined by the equation ar+by+co, where a is not equal to zero, b is not equal to zero, and a, b, and c are all integers. The slope of an CSILine is defined to be the double value al b.A point (represented by integers x and y) is on a CS1Line if the equation of the CS1Line is satisfied when those x and y values are substituted into the equation. That is, a point represented by x and y is on the line if ar + by +c is equal to 0. Examples of two cs1Line equations are shown in the following table. 6. Is point (5,-2) on the line? Equation Sx +4y- 17-0 514125 Yes, because 5(5)+4(2)+(-17)-0 -25x+40y+30-0 25/40 0.625 No, because 25(5)+ 40(-2)+30 0 Slope (-alb) Assume that the following code segment appears in the main function. The code segment shows an example of using the CS1Line class to represent the two equations shown in the table. CSiline linel (S, 4, 17) double slope1linel.getsiope 0; bool onLinel linel.isonLine(5, 2)i csiline line2(-25, 40, 30): // slopel is assigned -1.25 // true because 5(5) + 4(-2) + (-17)-0 double slope2 line2.getslope ) // slope2 is assigned 0.625 bool onLine2 1ine2.isonLine(5, -2) // false because -25(5) +40 (-2) + 30 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
