C# Class Spatial4n.Core.Distance.DistanceUtils

Afficher le fichier Open project: synhershko/Spatial4n Class Usage Examples

Méthodes publiques

Свойство Type Description
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

Méthodes publiques

Méthode Description
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

Method Details

CalcBoxByDistFromPtDEG() public static méthode

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
Résultat Rectangle

CalcBoxByDistFromPt_deltaLonDEG() public static méthode

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
Résultat double

CalcBoxByDistFromPt_latHorizAxisDEG() public static méthode

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
Résultat double

Degrees2Dist() public static méthode

public static Degrees2Dist ( double degrees, double radius ) : double
degrees double
radius double
Résultat double

Dist2Degrees() public static méthode

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
Résultat double

Dist2Radians() public static méthode

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
Résultat double

DistHaversineRAD() public static méthode

public static DistHaversineRAD ( double lat1, double lon1, double lat2, double lon2 ) : double
lat1 double
lon1 double
lat2 double
lon2 double
Résultat double

DistLawOfCosinesRAD() public static méthode

public static DistLawOfCosinesRAD ( double lat1, double lon1, double lat2, double lon2 ) : double
lat1 double
lon1 double
lat2 double
lon2 double
Résultat double

DistSquaredCartesian() public static méthode

public static DistSquaredCartesian ( double vec1, double vec2 ) : double
vec1 double
vec2 double
Résultat double

DistVincentyRAD() public static méthode

public static DistVincentyRAD ( double lat1, double lon1, double lat2, double lon2 ) : double
lat1 double
lon1 double
lat2 double
lon2 double
Résultat double

NormLatDEG() public static méthode

Puts in range -90 <= lat_deg <= 90.
public static NormLatDEG ( double lat_deg ) : double
lat_deg double
Résultat double

NormLonDEG() public static méthode

Puts in range -180 <= lon_deg <= +180.
public static NormLonDEG ( double lon_deg ) : double
lon_deg double
Résultat double

PointOnBearingRAD() public static méthode

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
Résultat System.Point

Radians2Dist() public static méthode

public static Radians2Dist ( double radians, double radius ) : double
radians double
radius double
Résultat double

ToDegrees() public static méthode

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
Résultat double

ToRadians() public static méthode

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
Résultat double

VectorBoxCorner() public static méthode

public static VectorBoxCorner ( double center, double result, double distance, bool upperRight ) : double[]
center double
result double
distance double
upperRight bool
Résultat double[]

VectorDistance() public static méthode

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.)
Résultat double

VectorDistance() public static méthode

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)}.
Résultat double

Property Details

DEGREES_TO_RADIANS public_oe static_oe property

public static double DEGREES_TO_RADIANS
Résultat double

DEG_180_AS_RADS public_oe static_oe property

public static double DEG_180_AS_RADS
Résultat double

DEG_225_AS_RADS public_oe static_oe property

public static double DEG_225_AS_RADS
Résultat double

DEG_270_AS_RADS public_oe static_oe property

public static double DEG_270_AS_RADS
Résultat double

DEG_45_AS_RADS public_oe static_oe property

public static double DEG_45_AS_RADS
Résultat double

DEG_90_AS_RADS public_oe static_oe property

public static double DEG_90_AS_RADS
Résultat double

DEG_TO_KM public_oe static_oe property

public static double DEG_TO_KM
Résultat double

EARTH_EQUATORIAL_RADIUS_KM public_oe static_oe property

public static double EARTH_EQUATORIAL_RADIUS_KM
Résultat double

EARTH_EQUATORIAL_RADIUS_MI public_oe static_oe property

public static double EARTH_EQUATORIAL_RADIUS_MI
Résultat double

EARTH_MEAN_RADIUS_KM public_oe static_oe property

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
Résultat double

EARTH_MEAN_RADIUS_MI public_oe static_oe property

public static double EARTH_MEAN_RADIUS_MI
Résultat double

KM_TO_DEG public_oe static_oe property

public static double KM_TO_DEG
Résultat double

KM_TO_MILES public_oe static_oe property

public static double KM_TO_MILES
Résultat double

MILES_TO_KM public_oe static_oe property

public static double MILES_TO_KM
Résultat double

RADIANS_TO_DEGREES public_oe static_oe property

public static double RADIANS_TO_DEGREES
Résultat double

SIN_45_AS_RADS public_oe static_oe property

public static double SIN_45_AS_RADS
Résultat double