public class DistanceCalcEuclidean extends DistanceCalcEarth
C, DIST_EARTH, KM_MILE, METERS_PER_DEGREE, R, R_EQ
Constructor and Description |
---|
DistanceCalcEuclidean() |
Modifier and Type | Method and Description |
---|---|
double |
calcCircumference(double lat)
Circumference of the earth at different latitudes (breitengrad)
|
double |
calcDenormalizedDist(double normedDist)
Inverse to calcNormalizedDist.
|
double |
calcDist(double fromY,
double fromX,
double toY,
double toX)
Calculates distance of (from, to) in meter.
|
double |
calcDist3D(double fromY,
double fromX,
double fromHeight,
double toY,
double toX,
double toHeight)
This implements a rather quick solution to calculate 3D distances on earth using euclidean
geometry mixed with Haversine formula used for the on earth distance.
|
double |
calcNormalizedDist(double dist)
Returns the specified length in normalized meter.
|
double |
calcNormalizedDist(double fromY,
double fromX,
double toY,
double toX)
Calculates in normalized meter
|
double |
calcNormalizedEdgeDistance(double ry,
double rx,
double ay,
double ax,
double by,
double bx)
This method calculates the distance from r to edge (a, b) where the crossing point is c
|
double |
calcNormalizedEdgeDistance3D(double ry,
double rx,
double rz,
double ay,
double ax,
double az,
double by,
double bx,
double bz)
This method calculates the distance from r to edge (a, b) where the crossing point is c including elevation
|
BBox |
createBBox(double lat,
double lon,
double radiusInMeter) |
GHPoint |
intermediatePoint(double f,
double lat1,
double lon1,
double lat2,
double lon2)
This methods creates a point (lat, lon in degrees) a fraction of the distance along the path from (lat1, lon1)
to (lat2, lon2).
|
boolean |
isCrossBoundary(double lon1,
double lon2) |
boolean |
isDateLineCrossOver(double lon1,
double lon2) |
GHPoint |
projectCoordinate(double latInDeg,
double lonInDeg,
double distanceInMeter,
double headingClockwiseFromNorth)
This methods creates a point (lat, lon in degrees) in a certain distance and direction from the specified
point (lat, lon in degrees).
|
String |
toString() |
calcCrossingPointToEdge, calcDistance, hasElevationDiff, validEdgeDistance
public double calcDist(double fromY, double fromX, double toY, double toX)
DistanceCalcEarth
http://en.wikipedia.org/wiki/Haversine_formula a = sin²(Δlat/2) + cos(lat1).cos(lat2).sin²(Δlong/2) c = 2.atan2(√a, √(1−a)) d = R.c
calcDist
in interface DistanceCalc
calcDist
in class DistanceCalcEarth
public double calcDist3D(double fromY, double fromX, double fromHeight, double toY, double toX, double toHeight)
DistanceCalcEarth
calcDist3D
in interface DistanceCalc
calcDist3D
in class DistanceCalcEarth
public double calcDenormalizedDist(double normedDist)
DistanceCalc
calcDenormalizedDist
in interface DistanceCalc
calcDenormalizedDist
in class DistanceCalcEarth
public double calcNormalizedDist(double dist)
calcNormalizedDist
in interface DistanceCalc
calcNormalizedDist
in class DistanceCalcEarth
public double calcNormalizedDist(double fromY, double fromX, double toY, double toX)
calcNormalizedDist
in interface DistanceCalc
calcNormalizedDist
in class DistanceCalcEarth
public String toString()
toString
in class DistanceCalcEarth
public double calcCircumference(double lat)
DistanceCalcEarth
calcCircumference
in interface DistanceCalc
calcCircumference
in class DistanceCalcEarth
public boolean isDateLineCrossOver(double lon1, double lon2)
isDateLineCrossOver
in class DistanceCalcEarth
public BBox createBBox(double lat, double lon, double radiusInMeter)
createBBox
in interface DistanceCalc
createBBox
in class DistanceCalcEarth
public GHPoint projectCoordinate(double latInDeg, double lonInDeg, double distanceInMeter, double headingClockwiseFromNorth)
DistanceCalc
projectCoordinate
in interface DistanceCalc
projectCoordinate
in class DistanceCalcEarth
public GHPoint intermediatePoint(double f, double lat1, double lon1, double lat2, double lon2)
DistanceCalc
intermediatePoint
in interface DistanceCalc
intermediatePoint
in class DistanceCalcEarth
public boolean isCrossBoundary(double lon1, double lon2)
isCrossBoundary
in interface DistanceCalc
isCrossBoundary
in class DistanceCalcEarth
public double calcNormalizedEdgeDistance(double ry, double rx, double ay, double ax, double by, double bx)
DistanceCalc
calcNormalizedEdgeDistance
in interface DistanceCalc
calcNormalizedEdgeDistance
in class DistanceCalcEarth
public double calcNormalizedEdgeDistance3D(double ry, double rx, double rz, double ay, double ax, double az, double by, double bx, double bz)
DistanceCalc
calcNormalizedEdgeDistance3D
in interface DistanceCalc
calcNormalizedEdgeDistance3D
in class DistanceCalcEarth
Copyright © 2012–2021. All rights reserved.