Vanetza
Loading...
Searching...
No Matches
distance.hpp
1#pragma once
2#include <vanetza/security/v3/asn1_types.hpp>
3#include <vanetza/units/angle.hpp>
4#include <vanetza/units/length.hpp>
5
6namespace vanetza
7{
8
9// forward declaration
10struct PositionFix;
11
12namespace security
13{
14namespace v3
15{
16
17/**
18 * Calculate distance between two positions using Haversine formula
19 *
20 * \param one a local position fix
21 * \param other a received location
22 * \return distance in meters
23 */
24units::Length distance(const PositionFix& one, const asn1::TwoDLocation& other);
25
26/**
27 * Convert ASN.1 latitude to GeoAngle
28 *
29 * \param in ASN.1 security latitude
30 * \return GeoAngle
31 */
32units::GeoAngle convert_latitude(const asn1::Latitude& in);
33
34/**
35 * Convert ASN.1 longitude to GeoAngle
36 *
37 * \param in ASN.1 security longitude
38 * \return GeoAngle
39 */
40units::GeoAngle convert_longitude(const asn1::Longitude& in);
41
42} // namespace v3
43} // namespace security
44} // namespace vanetza
boost::optional< Certificate > canonicalize() const
bool valid_at_timepoint(const Clock::time_point &time_point) const
StartAndEndValidity get_start_and_end_validity() const
bool valid_for_application(ItsAid aid) const
boost::optional< HashedId8 > calculate_digest() const
bool valid_at_location(const PositionFix &location, const LocationChecker *lc) const
boost::optional< HashedId8 > issuer_digest() const
Compressed_Lsb_Y_0 specified in TS 103 097 v1.2.1 in section 4.2.5.
Definition ecc_point.hpp:24
Compressed_Lsb_Y_1 specified in TS 103 097 v1.2.1 in section 4.2.5.
Definition ecc_point.hpp:30
EcdsaSignature specified in TS 103 097 v1.2.1, section 4.2.9.
Definition signature.hpp:17
Uncompressed specified in TS 103 097 v1.2.1 in section 4.2.5.
Definition ecc_point.hpp:36
X_Coordinate_Only specified in TS 103 097 v1.2.1 in section 4.2.5.
Definition ecc_point.hpp:18