// Path: src/main/java/com/indoqa/solr/spatial/corridor/debug/DebugValues.java
// public interface DebugValues {
// 
//     void add(String key, String value);
//     void add(String key, boolean value);
//     void add(String key, Number value);
// 
//     void addAngleDifference(String key, String value);
//     void addAngleDifference(String key, Number value);
//     void addAngleDifference(String key, Coordinate coordinate);
// 
//     void addSingleAngleDifference(String key, Number value);
// 
//     String toJson();
// }


import static com.indoqa.solr.spatial.corridor.CorridorConstants.WGS84_TO_KILOMETERS_FACTOR;
import static java.lang.Math.PI;
import com.indoqa.solr.spatial.corridor.debug.DebugValues;
import org.locationtech.jts.algorithm.Angle;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.LineString;
import org.locationtech.jts.geom.Point;
import org.locationtech.jts.linearref.LinearLocation;
import org.locationtech.jts.linearref.LocationIndexedLine;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;
/*
 * Licensed to the Indoqa Software Design und Beratung GmbH (Indoqa) under
 * one or more contributor license agreements. See the NOTICE file distributed
 * with this work for additional information regarding copyright ownership.
 * Indoqa licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.indoqa.solr.spatial.corridor.direction;




public class AngleUtils {

    public static double angle(Coordinate c1, Coordinate c2) {
        double angleInRadians = Angle.angle(c1, c2);
        return angleInRadians * (180 / PI);
    }

// Path: src/main/java/com/indoqa/solr/spatial/corridor/debug/DebugValues.java
// public interface DebugValues {
// 
//     void add(String key, String value);
//     void add(String key, boolean value);
//     void add(String key, Number value);
// 
//     void addAngleDifference(String key, String value);
//     void addAngleDifference(String key, Number value);
//     void addAngleDifference(String key, Coordinate coordinate);
// 
//     void addSingleAngleDifference(String key, Number value);
// 
//     String toJson();
// }


// Path: src/main/java/com/indoqa/solr/spatial/corridor/direction/AngleUtils.java
import static com.indoqa.solr.spatial.corridor.CorridorConstants.WGS84_TO_KILOMETERS_FACTOR;
import static java.lang.Math.PI;
import com.indoqa.solr.spatial.corridor.debug.DebugValues;
import org.locationtech.jts.algorithm.Angle;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.LineString;
import org.locationtech.jts.geom.Point;
import org.locationtech.jts.linearref.LinearLocation;
import org.locationtech.jts.linearref.LocationIndexedLine;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

/*
 * Licensed to the Indoqa Software Design und Beratung GmbH (Indoqa) under
 * one or more contributor license agreements. See the NOTICE file distributed
 * with this work for additional information regarding copyright ownership.
 * Indoqa licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.indoqa.solr.spatial.corridor.direction;




public class AngleUtils {

    public static double angle(Coordinate c1, Coordinate c2) {
        double angleInRadians = Angle.angle(c1, c2);
        return angleInRadians * (180 / PI);
    }

    protected static double getAngleDifference(DebugValues debugValues, LineString lineString, List<Point> queryPoints, double maxDistance) {