C# Класс Spatial4n.Core.Distance.DistanceUtils

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
DEGREES_TO_RADIANS double
DEG_180_AS_RADS double
DEG_225_AS_RADS double
DEG_270_AS_RADS double
DEG_45_AS_RADS double
DEG_90_AS_RADS double
DEG_TO_KM double
EARTH_EQUATORIAL_RADIUS_KM double
EARTH_EQUATORIAL_RADIUS_MI double
EARTH_MEAN_RADIUS_KM double
EARTH_MEAN_RADIUS_MI double
KM_TO_DEG double
KM_TO_MILES double
MILES_TO_KM double
RADIANS_TO_DEGREES double
SIN_45_AS_RADS double

Открытые методы

Метод Описание
CalcBoxByDistFromPtDEG ( double lat, double lon, double distDEG, SpatialContext ctx, Rectangle reuse ) : Rectangle
CalcBoxByDistFromPt_deltaLonDEG ( double lat, double lon, double distDEG ) : double

The delta longitude of a point-distance. In other words, half the width of the bounding box of a circle.

CalcBoxByDistFromPt_latHorizAxisDEG ( double lat, double lon, double distDEG ) : double

The latitude of the horizontal axis (e.g. left-right line) of a circle. The horizontal axis of a circle passes through its furthest left-most and right-most edges. On a 2D plane, this result is always from.getY() but, perhaps surprisingly, on a sphere it is going to be slightly different.

Degrees2Dist ( double degrees, double radius ) : double
Dist2Degrees ( double dist, double radius ) : double

Converts a distance in the units of the radius to degrees (360 degrees are in a circle). A spherical earth model is assumed.

Dist2Radians ( double dist, double radius ) : double

Converts a distance in the units of radius (e.g. kilometers) to radians (multiples of the radius). A spherical earth model is assumed.

DistHaversineRAD ( double lat1, double lon1, double lat2, double lon2 ) : double
DistLawOfCosinesRAD ( double lat1, double lon1, double lat2, double lon2 ) : double
DistSquaredCartesian ( double vec1, double vec2 ) : double
DistVincentyRAD ( double lat1, double lon1, double lat2, double lon2 ) : double
NormLatDEG ( double lat_deg ) : double

Puts in range -90 <= lat_deg <= 90.

NormLonDEG ( double lon_deg ) : double

Puts in range -180 <= lon_deg <= +180.

PointOnBearingRAD ( double startLat, double startLon, double distanceRAD, double bearingRAD, SpatialContext ctx, System.Point reuse ) : System.Point
Radians2Dist ( double radians, double radius ) : double
ToDegrees ( double radians ) : double

Same as {@link Math#toDegrees(double)} but 3x faster (multiply vs. divide). See CompareRadiansSnippet.java in tests.

ToRadians ( double degrees ) : double

Same as {@link Math#toRadians(double)} but 3x faster (multiply vs. divide). See CompareRadiansSnippet.java in tests.

VectorBoxCorner ( double center, double result, double distance, bool upperRight ) : double[]
VectorDistance ( double vec1, double vec2, double power ) : double

Calculate the p-norm (i.e. length) between two vectors

VectorDistance ( double vec1, double vec2, double power, double oneOverPower ) : double

Calculate the p-norm (i.e. length) between two vectors

Описание методов

CalcBoxByDistFromPtDEG() публичный статический Метод

public static CalcBoxByDistFromPtDEG ( double lat, double lon, double distDEG, SpatialContext ctx, Rectangle reuse ) : Rectangle
lat double
lon double
distDEG double
ctx Spatial4n.Core.Context.SpatialContext
reuse Rectangle
Результат Rectangle

CalcBoxByDistFromPt_deltaLonDEG() публичный статический Метод

The delta longitude of a point-distance. In other words, half the width of the bounding box of a circle.
public static CalcBoxByDistFromPt_deltaLonDEG ( double lat, double lon, double distDEG ) : double
lat double
lon double
distDEG double
Результат double

CalcBoxByDistFromPt_latHorizAxisDEG() публичный статический Метод

The latitude of the horizontal axis (e.g. left-right line) of a circle. The horizontal axis of a circle passes through its furthest left-most and right-most edges. On a 2D plane, this result is always from.getY() but, perhaps surprisingly, on a sphere it is going to be slightly different.
public static CalcBoxByDistFromPt_latHorizAxisDEG ( double lat, double lon, double distDEG ) : double
lat double
lon double
distDEG double
Результат double

Degrees2Dist() публичный статический Метод

public static Degrees2Dist ( double degrees, double radius ) : double
degrees double
radius double
Результат double

Dist2Degrees() публичный статический Метод

Converts a distance in the units of the radius to degrees (360 degrees are in a circle). A spherical earth model is assumed.
public static Dist2Degrees ( double dist, double radius ) : double
dist double
radius double
Результат double

Dist2Radians() публичный статический Метод

Converts a distance in the units of radius (e.g. kilometers) to radians (multiples of the radius). A spherical earth model is assumed.
public static Dist2Radians ( double dist, double radius ) : double
dist double
radius double
Результат double

DistHaversineRAD() публичный статический Метод

public static DistHaversineRAD ( double lat1, double lon1, double lat2, double lon2 ) : double
lat1 double
lon1 double
lat2 double
lon2 double
Результат double

DistLawOfCosinesRAD() публичный статический Метод

public static DistLawOfCosinesRAD ( double lat1, double lon1, double lat2, double lon2 ) : double
lat1 double
lon1 double
lat2 double
lon2 double
Результат double

DistSquaredCartesian() публичный статический Метод

public static DistSquaredCartesian ( double vec1, double vec2 ) : double
vec1 double
vec2 double
Результат double

DistVincentyRAD() публичный статический Метод

public static DistVincentyRAD ( double lat1, double lon1, double lat2, double lon2 ) : double
lat1 double
lon1 double
lat2 double
lon2 double
Результат double

NormLatDEG() публичный статический Метод

Puts in range -90 <= lat_deg <= 90.
public static NormLatDEG ( double lat_deg ) : double
lat_deg double
Результат double

NormLonDEG() публичный статический Метод

Puts in range -180 <= lon_deg <= +180.
public static NormLonDEG ( double lon_deg ) : double
lon_deg double
Результат double

PointOnBearingRAD() публичный статический Метод

public static PointOnBearingRAD ( double startLat, double startLon, double distanceRAD, double bearingRAD, SpatialContext ctx, System.Point reuse ) : System.Point
startLat double
startLon double
distanceRAD double
bearingRAD double
ctx Spatial4n.Core.Context.SpatialContext
reuse System.Point
Результат System.Point

Radians2Dist() публичный статический Метод

public static Radians2Dist ( double radians, double radius ) : double
radians double
radius double
Результат double

ToDegrees() публичный статический Метод

Same as {@link Math#toDegrees(double)} but 3x faster (multiply vs. divide). See CompareRadiansSnippet.java in tests.
public static ToDegrees ( double radians ) : double
radians double
Результат double

ToRadians() публичный статический Метод

Same as {@link Math#toRadians(double)} but 3x faster (multiply vs. divide). See CompareRadiansSnippet.java in tests.
public static ToRadians ( double degrees ) : double
degrees double
Результат double

VectorBoxCorner() публичный статический Метод

public static VectorBoxCorner ( double center, double result, double distance, bool upperRight ) : double[]
center double
result double
distance double
upperRight bool
Результат double[]

VectorDistance() публичный статический Метод

Calculate the p-norm (i.e. length) between two vectors
public static VectorDistance ( double vec1, double vec2, double power ) : double
vec1 double The first vector
vec2 double The second vector
power double The power (2 for cartesian distance, 1 for manhattan, etc.)
Результат double

VectorDistance() публичный статический Метод

Calculate the p-norm (i.e. length) between two vectors
public static VectorDistance ( double vec1, double vec2, double power, double oneOverPower ) : double
vec1 double The first vector
vec2 double The second vector
power double The power (2 for cartesian distance, 1 for manhattan, etc.)
oneOverPower double If you've precalculated oneOverPower and cached it, use this method to save one division operation over {@link #vectorDistance(double[], double[], double)}.
Результат double

Описание свойств

DEGREES_TO_RADIANS публичное статическое свойство

public static double DEGREES_TO_RADIANS
Результат double

DEG_180_AS_RADS публичное статическое свойство

public static double DEG_180_AS_RADS
Результат double

DEG_225_AS_RADS публичное статическое свойство

public static double DEG_225_AS_RADS
Результат double

DEG_270_AS_RADS публичное статическое свойство

public static double DEG_270_AS_RADS
Результат double

DEG_45_AS_RADS публичное статическое свойство

public static double DEG_45_AS_RADS
Результат double

DEG_90_AS_RADS публичное статическое свойство

public static double DEG_90_AS_RADS
Результат double

DEG_TO_KM публичное статическое свойство

public static double DEG_TO_KM
Результат double

EARTH_EQUATORIAL_RADIUS_KM публичное статическое свойство

public static double EARTH_EQUATORIAL_RADIUS_KM
Результат double

EARTH_EQUATORIAL_RADIUS_MI публичное статическое свойство

public static double EARTH_EQUATORIAL_RADIUS_MI
Результат double

EARTH_MEAN_RADIUS_KM публичное статическое свойство

The International Union of Geodesy and Geophysics says the Earth's mean radius in KM is: [1] http://en.wikipedia.org/wiki/Earth_radius
public static double EARTH_MEAN_RADIUS_KM
Результат double

EARTH_MEAN_RADIUS_MI публичное статическое свойство

public static double EARTH_MEAN_RADIUS_MI
Результат double

KM_TO_DEG публичное статическое свойство

public static double KM_TO_DEG
Результат double

KM_TO_MILES публичное статическое свойство

public static double KM_TO_MILES
Результат double

MILES_TO_KM публичное статическое свойство

public static double MILES_TO_KM
Результат double

RADIANS_TO_DEGREES публичное статическое свойство

public static double RADIANS_TO_DEGREES
Результат double

SIN_45_AS_RADS публичное статическое свойство

public static double SIN_45_AS_RADS
Результат double