How to use @turf/rhumb-distance - 3 common examples

To help you get started, we’ve selected a few @turf/rhumb-distance examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Turfjs / turf / packages / turf-point-to-line-distance / index.ts View on Github external
function calcDistance(a: number[], b: number[], options: any) {
    return options.method === "planar" ? getPlanarDistance(a, b, options) : getDistance(a, b, options);
}
github Turfjs / turf / packages / turf-transform-scale / index.js View on Github external
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;
    });
github Turfjs / turf / packages / turf-transform-rotate / index.js View on Github external
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;

@turf/rhumb-distance

turf rhumb-distance module

MIT
Latest version published 3 years ago

Package Health Score

80 / 100
Full package analysis

Popular @turf/rhumb-distance functions