mast/tools/processor.py
def __calculate_orthodromic_distance(self, segment: list) -> float:
        """
        Purpose of this method is to calculate distance between provided
        coordinates in order to obtain total distance.
        :param segment: List of track points.
        :return: Total distance achieved.
        """
        buffer = 0

        for index in range(len(segment) - 1):
            lat1 = radians(float(segment[index].attrib['lat']))
            lat2 = radians(float(segment[index + 1].attrib['lat']))
            lon1 = radians(float(segment[index].attrib['lon']))
            lon2 = radians(float(segment[index + 1].attrib['lon']))

            dist_lat = lat2 - lat1
            dist_lon = lon2 - lon1
            pom = sin(dist_lat / 2) ** 2 + cos(lat1) * cos(lat2) * sin(dist_lon / 2) ** 2

            buffer += self.EARTH_RADIUS * (2 * asin(sqrt(pom)))
        return buffer

        Purpose of this method is to calculate distance between provided
        coordinates in order to obtain total distance.
        :param segment: List of track points.
        :return: Total distance achieved.
        
Purpose of this method is to calculate distance between provided
coordinates in order to obtain total distance.
Purpose of this method is to calculate distance between provided coordinates in order to obtain total distance .
def __calculate_orthodromic_distance(self, segment: list) -> float:
        buffer = 0
        for index in range(len(segment) - 1):
            lat1 = radians(float(segment[index].attrib['lat']))
            lat2 = radians(float(segment[index + 1].attrib['lat']))
            lon1 = radians(float(segment[index].attrib['lon']))
            lon2 = radians(float(segment[index + 1].attrib['lon']))
            dist_lat = lat2 - lat1
            dist_lon = lon2 - lon1
            pom = sin(dist_lat / 2) ** 2 + cos(lat1) * cos(lat2) * sin(dist_lon / 2) ** 2
            buffer += self.EARTH_RADIUS * (2 * asin(sqrt(pom)))
        return buffer
def __calculate_orthodromic_distance ( self , segment : list ) -> float : buffer = 0 for index in range ( len ( segment ) - 1 ) : lat1 = radians ( float ( segment [ index ] . attrib [ 'lat' ] ) ) lat2 = radians ( float ( segment [ index + 1 ] . attrib [ 'lat' ] ) ) lon1 = radians ( float ( segment [ index ] . attrib [ 'lon' ] ) ) lon2 = radians ( float ( segment [ index + 1 ] . attrib [ 'lon' ] ) ) dist_lat = lat2 - lat1 dist_lon = lon2 - lon1 pom = sin ( dist_lat / 2 ) ** 2 + cos ( lat1 ) * cos ( lat2 ) * sin ( dist_lon / 2 ) ** 2 buffer += self . EARTH_RADIUS * ( 2 * asin ( sqrt ( pom ) ) ) return buffer
Purpose of this method is to calculate distance between provided
coordinates in order to obtain total distance.
Purpose of this method is to calculate distance between provided coordinates in order to obtain total distance .
"""
        Purpose of this method is to calculate distance between provided
        coordinates in order to obtain total distance.
        :param segment: List of track points.
        :return: Total distance achieved.
        """
Total distance achieved.
Total distance achieved .
self
segment
list
List of track points.
List of track points .