remove some unused geo objects

This commit is contained in:
rolux 2012-04-11 22:37:20 +02:00
parent b28eb7ec51
commit 1d9bf5aacd

View file

@ -450,132 +450,3 @@
}());
//@ Ox.Line <f> (undocumented)
Ox.Line = function(pointA, pointB) {
var self = {
points: [pointA, pointB]
},
that = this;
function rad() {
return self.points.map(function(point) {
return {
lat: Ox.rad(point.lat()),
lng: Ox.rad(point.lng())
};
});
}
that.getArea = function() {
};
that.getBearing = function() {
};
that.getDistance = function() {
var points = rad();
return Math.acos(
Math.sin(point[0].lat) * Math.sin(point[1].lat) +
Math.cos(point[0].lat) * Math.cos(point[1].lat) *
Math.cos(point[1].lng - point[0].lng)
) * Ox.EARTH_RADIUS;
};
that.getMidpoint = function() {
var points = rad(),
x = Math.cos(point[1].lat) *
Math.cos(point[1].lng - point[0].lng),
y = Math.cos(point[1].lat) *
Math.sin(point[1].lng - point[0].lng),
d = Math.sqrt(
Math.pow(Math.cos(point[0].lat) + x, 2) + Math.pow(y, 2)
),
lat = Ox.deg(
Math.atan2(Math.sin(points[0].lat) + Math.sin(points[1].lat), d)
),
lng = Ox.deg(
points[0].lng + Math.atan2(y, math.cos(points[0].lat) + x)
);
return new Point(lat, lng);
};
that.points = function() {
};
return that;
};
//@ Ox.Point <f> (undocumented)
Ox.Point = function(lat, lng) {
var self = {lat: lat, lng: lng},
that = this;
that.lat = function() {
};
that.latlng = function() {
};
that.lng = function() {
};
that.getMetersPerDegree = function() {
return Math.cos(self.lat * Math.PI / 180) *
Ox.EARTH_CIRCUMFERENCE / 360;
}
that.getXY = function() {
return [
getXY(Ox.rad(self.lng)),
getXY(Ox.asinh(Math.tan(Ox.rad(-self.lat))))
];
};
return that;
};
//@ Ox.Rectangle <f> (undocumented)
Ox.Rectangle = function(pointA, pointB) {
var self = {
points: [
new Point(
Math.min(pointA.lat(), pointB.lat()),
pointA.lng()
),
new Point(
Math.max(pointA.lat(), pointB.lat()),
pointB.lng()
)
]
},
that = this;
that.contains = function(rectangle) {
};
that.crossesDateline = function() {
return self.points[0].lng > self.points[1].lng;
}
that.getCenter = function() {
return new Ox.Line(self.points[0], self.points[1]).getMidpoint();
};
that.intersects = function(rectangle) {
};
return that;
};