Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function calcDistance(a: number[], b: number[], options: any) {
return options.method === "planar" ? getPlanarDistance(a, b, options) : getDistance(a, b, options);
}
coordEach(feature, function (coord) {
var originalDistance = rhumbDistance(origin, coord);
var bearing = rhumbBearing(origin, coord);
var newDistance = originalDistance * factor;
var newCoord = getCoords(rhumbDestination(origin, newDistance, bearing));
coord[0] = newCoord[0];
coord[1] = newCoord[1];
if (coord.length === 3) coord[2] *= factor;
});
coordEach(geojson, function (pointCoords) {
var initialAngle = rhumbBearing(pivot, pointCoords);
var finalAngle = initialAngle + angle;
var distance = rhumbDistance(pivot, pointCoords);
var newCoords = getCoords(rhumbDestination(pivot, distance, finalAngle));
pointCoords[0] = newCoords[0];
pointCoords[1] = newCoords[1];
});
return geojson;