Commit 24371ec6 authored by garciay's avatar garciay
Browse files

Add external function fx_getDSecond()

parent 231a53e4
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -309,10 +309,10 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid
//                "fx_computePositionFromRotation",
//                String.format("%d", p_rotation.getFloat()));
        // 1. Compute distance between the 2 points
        double lat1 = Math.toRadians((double)p_cenLatitude.getInteger() / 10000000.0);
        double long1 = Math.toRadians((double)p_cenLongitude.getInteger() / 10000000.0);
        double lat2 = Math.toRadians((double)p_refLatitude.getInteger() / 10000000.0);
        double long2 = Math.toRadians((double)p_refLongitude.getInteger() / 10000000.0);
        double lat1 = Math.toRadians((double)_tcicdWrapper.getInteger(p_cenLatitude) / 10000000.0);
        double long1 = Math.toRadians((double)_tcicdWrapper.getInteger(p_cenLongitude) / 10000000.0);
        double lat2 = Math.toRadians((double)_tcicdWrapper.getInteger(p_refLatitude) / 10000000.0);
        double long2 = Math.toRadians((double)_tcicdWrapper.getInteger(p_refLongitude) / 10000000.0);
        double dlat = lat2 - lat1;
        double dlong = long2 - long1;
        double a = Math.sin(dlat / 2) * Math.sin(dlat / 2) + Math.cos(lat1) * Math.cos(lat2) * Math.sin(dlong / 2) * Math.sin(dlong / 2);
@@ -327,7 +327,7 @@ public class ItsExternalFunctionsProvider implements IItsExternalFunctionsProvid
        //TERFactory.getInstance().logDebug("fx_computePositionFromRotation: Bearing = " + Math.toDegrees(brng));
        
        // 3. Compute distance between the 2 points
        double rotation = Math.toRadians((double)p_rotation.getInteger() / 10.0) + brng;
        double rotation = Math.toRadians((double)_tcicdWrapper.getInteger(p_rotation) / 10.0) + brng;
        //TERFactory.getInstance().logDebug("fx_computePositionFromRotation = rotation: " + Math.toDegrees(rotation));
        double lat = Math.asin(Math.sin(lat1) * Math.cos(c) + Math.cos(lat1) * Math.sin(c) * Math.cos(rotation));
        double long_ = long1 + Math.atan2(Math.sin(rotation) * Math.sin(c)*Math.cos(lat1), Math.cos(c) - Math.sin(lat1) * Math.sin(lat));