Lambda with multiple operators in Java

class Point {
    public double x;
    public double y;
    
    public Point(double xdouble y) {
        this.x = x;
        this.y = y;
    }
}

BiFunction<Point, Point, Double> getDistance = (p1p2) -> {
    double d1 = Math.pow(p1.x - p2.x, 2);
    double d2 = Math.pow(p1.y - p2.y, 2);
    return Math.sqrt(d1 + d2);
};

Point point1 = new Point(0, 0);
Point point2 = new Point(5, 5);
Double distance = getDistance.apply(point1point2);
//distance is 7.071