public static double squaredMagnitude(List<Double> point) {
        double sum = 0;
        int size = point.size();
        for (int i = 0; i < size; i++) {
            double val = point.get(i);
            sum += val * val;
        }
        return sum;
    }