calculation#

class airtrafficsim.utils.calculation.Cal#

A utility class for calculation

Methods

cal_angle_diff(current_angle, target_angle)

Calculate the difference of two angle (+ve clockwise, -ve anti-clockwise.

cal_cross_track_dist(path_lat1, path_long1, ...)

Calculate the cross track distance between point(s) along a great circle path.

cal_dest_given_dist_bearing(lat, long, ...)

Calculate the destination point(s) given start point(s), bearing(s) and distance(s)

cal_great_circle_bearing(lat1, long1, lat2, ...)

Calculate the great circle bearing of two points.

cal_great_circle_dist(lat1, long1, lat2, long2)

Calculate great circle distance in km between two point.

static cal_great_circle_dist(lat1, long1, lat2, long2)#

Calculate great circle distance in km between two point.

Parameters:
lat1float[]

Latitude of first point(s) [deg]

long1float[]

Longitude of first point(s) [deg]

lat2float[]

Latitude of second point(s) [deg]

long2float[]

Longitude of second point(s) [deg]

Returns:
float[]

Great circle distance [km]

Notes

Haversine distance using mean Earth radius 6371.009km for the WGS84 ellipsoid. https://www.movable-type.co.uk/scripts/latlong.html

static cal_great_circle_bearing(lat1, long1, lat2, long2)#

Calculate the great circle bearing of two points.

Parameters:
lat1float[]

Latitude of first point(s) [deg]

long1float[]

Longitude of first point(s) [deg]

lat2float[]

Latitude of second point(s) [deg]

long2float[]

Longitude of second point(s) [deg]

Returns:
float[]

Bearing [deg 0-360]

Notes

Initial bearing or forward azimuth https://www.movable-type.co.uk/scripts/latlong.html

static cal_dest_given_dist_bearing(lat, long, bearing, dist)#

Calculate the destination point(s) given start point(s), bearing(s) and distance(s)

Parameters:
latfloat[]

Latitude of start point(s) [deg]

longfloat[]

Longitude of start point(s) [deg]

bearingfloat[]

Target bearing(s) [deg 0-360]

distfloat[]

Target distance(s) [km]

Returns:
lat2float[]

Latitude of destination(s) [deg]

long2float[]

Longitude of destination(s) [deg]

Notes

Using mean Earth radius 6371.009km for the WGS84 ellipsoid. https://www.movable-type.co.uk/scripts/latlong.html

static cal_cross_track_dist(path_lat1, path_long1, path_lat2, path_long2, point_lat, point_long)#

Calculate the cross track distance between point(s) along a great circle path.

Parameters:
path_lat1float

Latitude of first point of great circle path [deg]

path_long1float

Longitude of first point of great circle path [deg]

path_lat2float

Latitude of second point of great circle path [deg]

path_long2float

Longitude of second point of great circle point [deg]

point_latfloat[]

Latitude of point(s) [deg]

point_longfloat[]

Longitude of point(s) [deg]

Returns:
float[]

Cross track distance [km]

Notes

Cross track distance using mean Earth radius 6371.009km for the WGS84 ellipsoid. https://www.movable-type.co.uk/scripts/latlong.html

static cal_angle_diff(current_angle, target_angle)#

Calculate the difference of two angle (+ve clockwise, -ve anti-clockwise.

Parameters:
current_anglefloat[]

Current angle [deg]

target_anglefloat[]

Target angle [deg]

Returns:
float[]

Angle difference [deg]