Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class E325 {
- public static void main(String[] args) {
- /*
- * The purpose of this program is to find the intersect
- * of two lines given by the user by four points
- *
- * Get the four points. x1,y1 x2,y2 x3,y3 x4,y4
- */
- Scanner input = new Scanner(System.in);
- System.out.print("Enter x1 y1, x2 y2, x3 y3, x4 y4: ");
- double x1 = input.nextDouble();
- double y1 = input.nextDouble();
- double x2 = input.nextDouble();
- double y2 = input.nextDouble();
- double x3 = input.nextDouble();
- double y3 = input.nextDouble();
- double x4 = input.nextDouble();
- double y4 = input.nextDouble();
- }
- }
- y = m*x + b
- -m1*x + y = b1
- -m2*x + y = b2
- [ -m1 1 ]{x} = {b1}
- [ -m2 1 ]{y} {b2}
Add Comment
Please, Sign In to add comment