Page 1 of 1

6.30 AP Line An APLine is a line defined by the equation ax +by+C =0, where a is not equal to zero, bis not equal to zer

Posted: Fri May 20, 2022 2:49 pm
by answerhappygod
6 30 Ap Line An Apline Is A Line Defined By The Equation Ax By C 0 Where A Is Not Equal To Zero Bis Not Equal To Zer 1
6 30 Ap Line An Apline Is A Line Defined By The Equation Ax By C 0 Where A Is Not Equal To Zero Bis Not Equal To Zer 1 (46.31 KiB) Viewed 32 times
6 30 Ap Line An Apline Is A Line Defined By The Equation Ax By C 0 Where A Is Not Equal To Zero Bis Not Equal To Zer 2
6 30 Ap Line An Apline Is A Line Defined By The Equation Ax By C 0 Where A Is Not Equal To Zero Bis Not Equal To Zer 2 (37.1 KiB) Viewed 32 times
6 30 Ap Line An Apline Is A Line Defined By The Equation Ax By C 0 Where A Is Not Equal To Zero Bis Not Equal To Zer 3
6 30 Ap Line An Apline Is A Line Defined By The Equation Ax By C 0 Where A Is Not Equal To Zero Bis Not Equal To Zer 3 (30.19 KiB) Viewed 32 times
6 30 Ap Line An Apline Is A Line Defined By The Equation Ax By C 0 Where A Is Not Equal To Zero Bis Not Equal To Zer 4
6 30 Ap Line An Apline Is A Line Defined By The Equation Ax By C 0 Where A Is Not Equal To Zero Bis Not Equal To Zer 4 (19.47 KiB) Viewed 32 times
6.30 AP Line An APLine is a line defined by the equation ax +by+C =0, where a is not equal to zero, bis not equal to zero, and a, b, and c are all integers. The slope of an APLine is defined to be the double value-a/b. A point (represented by integers x and y) is on an APLine if the equation of the APLine 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 ax + by + C is equal to 0. Examples of two APLine equations are shown in the following table. Equation Slope (a is point (5,2) on the /b) line? -5/4 = Yes, because 5(5) + -1.25 4(-2) + (-17) = 0 5x + 4y - 17 = 0 -25x - 40y + 30 = 0 -25/40 No, because -25(5) = -0.625 +40(-2) + 30 =/= 0 Write the APLine class. Your implementation must include: 1- A constructor that has three integer

must include: 1- A constructor that has three integer parameters that represent a, b, and c, in that order. You may assume that the values of the parameters representing a and b are not zero. 2- A method getSlope that calculates and returns the slope of the line. 3- A method isOnLine that returns true if the point represented by its two parameters (x and y, in that order) is on the APLine and returns false otherwise. Example: Input -25-40 30 Output a = -25, b = -40, C = 30 Slope: -0.625 On line: false Input 54-17 Output a = 5, b = 4, C = -17 Slope: -1.25 On line: true

File is marked as read only Current file: Main.java 3 public class Main 4 { 5 public static void main(String[] args) 6 { 7 Scanner scnr = new Scanner(System.in); 8 int a = scnr.nextInt(); 9 int b = scnr.nextInt(); 10 int c = scnr.nextInt(); 11 12 System.out.println("a = "+a+", b = "+b+", C = "+c); //print the 13 APLine linel = new APLine(a, 14 System.out.println("Slope: + line1.getslope()); 16 System.out.println("On line: " + linei. isOnLine(5, -2)); 17 18 } 15

Current file: APLine.java 1 public class APLine 2{ 3 private int a,b,c; 4 5 public APLine(int a1, int bi, int ci) 6 { 7 // Your code here 8 } 9 10 public double getslope() { 12 // Your code here 13 } OVOU AWNA 11 HH2 NP 14 15 public boolean isOnLine(int x, int v)