Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ITS - Intelligent Transport Systems
ITS
Commits
24371ec6
Commit
24371ec6
authored
Nov 07, 2016
by
garciay
Browse files
Add external function fx_getDSecond()
parent
231a53e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
javasrc/extfunc/org/etsi/its/extfunc/ItsExternalFunctionsProvider.java
View file @
24371ec6
...
...
@@ -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
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment