node-red-contrib-tak-registration
Version:
A Node-RED node to register to TAK and to help wrap files as datapackages to send to TAK
32 lines (31 loc) • 1.34 kB
TypeScript
import { Coord, Feature, Point, Properties, Units } from "@turf/helpers";
/**
* Takes a {@link Point} and calculates the location of a destination point given a distance in
* degrees, radians, miles, or kilometers; and bearing in degrees.
* This uses the [Haversine formula](http://en.wikipedia.org/wiki/Haversine_formula) to account for global curvature.
*
* @name destination
* @param {Coord} origin starting point
* @param {number} distance distance from the origin point
* @param {number} bearing ranging from -180 to 180
* @param {Object} [options={}] Optional parameters
* @param {string} [options.units='kilometers'] miles, kilometers, degrees, or radians
* @param {Object} [options.properties={}] Translate properties to Point
* @returns {Feature<Point>} destination point
* @example
* var point = turf.point([-75.343, 39.984]);
* var distance = 50;
* var bearing = 90;
* var options = {units: 'miles'};
*
* var destination = turf.destination(point, distance, bearing, options);
*
* //addToMap
* var addToMap = [point, destination]
* destination.properties['marker-color'] = '#f00';
* point.properties['marker-color'] = '#0f0';
*/
export default function destination<P = Properties>(origin: Coord, distance: number, bearing: number, options?: {
units?: Units;
properties?: P;
}): Feature<Point, P>;