@Override
    public double[] intersect(Ray ray) {
        Vector3 rayToTop = ray.getFrom().subtract(top);
        
        double AxR = direction.dotProduct(ray.getDirection());
        double AxBR = direction.dotProduct(rayToTop);
        double cosSquare = Math.pow(Math.cos(angle), 2);
        
        double paramA = AxR * AxR - cosSquare * ray.getDirection().dotProduct(ray.getDirection());
        double paramB = 2 * (AxR * AxBR - cosSquare * ray.getDirection().dotProduct(rayToTop));
        double paramC = AxBR * AxBR - cosSquare * rayToTop.dotProduct(rayToTop);
        
        double roots[] = MathUtils.solveQuadraticEquation(paramA, paramB, paramC);
        
        if (roots != null) {            
            if (roots.length > 1) {
                double minRoot = Math.min(roots[0], roots[1]);
                double maxRoot = Math.max(roots[0], roots[1]);
                
                if (checkRoot(ray, minRoot)) {
                    return new double[] {minRoot, maxRoot};
                } else if (checkRoot(ray, maxRoot)) {
                    return new double[] {maxRoot};
                }                
            } else {
                if (checkRoot(ray, roots[0])) {
                    return roots;
                }                
            }
        }
        
        return EMPTY;
    }