code: public static  RPNode query(RPNode from,RPHyperPlanes planes,INDArray x,String similarityFunction) {
          if(from.getLeft() == null && from.getRight() == null) {
              return from;
          }
  
          INDArray hyperPlane = planes.getHyperPlaneAt(from.getDepth());
          double dist = computeDistance(similarityFunction,x,hyperPlane);
          if(dist <= from.getMedian()) {
              return query(from.getLeft(),planes,x,similarityFunction);
          }
  
          else {
              return query(from.getRight(),planes,x,similarityFunction);
          }
  
      }
docs: Query the tree starting from the given node
  using the given hyper plane and similarity function
  @param from the node to start from
  @param planes the hyper plane to query
  @param x the input data
  @param similarityFunction the similarity function to use
  @return the leaf node representing the given query from a
  search in the tree