Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- // ТОЧКА ПЕРЕСЕЧЕНИЯ БИССЕКТРИС
- Scanner sc = new Scanner(System.in);
- double x1 = sc.nextDouble();
- double y1 = sc.nextDouble();
- double x2 = sc.nextDouble();
- double y2 = sc.nextDouble();
- double x3 = sc.nextDouble();
- double y3 = sc.nextDouble();
- double AB = Math.sqrt(Math.pow(x2-x1,2) + Math.pow(y2-y1,2));
- double AC = Math.sqrt(Math.pow(x3-x1,2) + Math.pow(y3-y1,2));
- double BC = Math.sqrt(Math.pow(x3-x2,2) + Math.pow(y3-y2,2));
- double corx = (BC*x1+AC*x2+AB*x3)/(BC+AC+AB);
- double cory = (BC*y1+AC*y2+AB*y3)/(BC+AC+AB);
- System.out.println(corx + " " + cory);
- }
- }
Add Comment
Please, Sign In to add comment