New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

geo-hunter

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geo-hunter

A library for calculating interception points of aerial targets based on coordinates (EPSG:4326).

latest
Source
npmnpm
Version
1.2.1
Version published
Maintainers
1
Created
Source

Geo Hunter

Geo Hunter is a Node.js library for calculating the interception point of an aerial target based on its coordinates in the EPSG:4326 format (latitude and longitude). It is designed for geographic and aerodynamic calculations, taking into account parameters such as speed, direction, altitude, and maximum range.

Features

  • Interception Point Calculation: Determines the optimal interception point based on the trajectory of the target and the characteristics of the interceptor.
  • EPSG:4326 Support: Works with geographic coordinates in latitude and longitude format.
  • Altitude Awareness: Considers the vertical distance between the target and the interceptor.
  • Trajectory Analysis: Generates the trajectory of the target based on its direction and speed.
  • Configurable Parameters: Allows customization of interceptor properties, such as speed, operational range, and starting position.
  • Precision Calculations: Uses advanced geographic formulas to ensure accurate results.

Installation

To install Geo Hunter, use npm:

npm install geo-hunter

Usage

Example: Calculating the Interception Point (JavaScript)

const { makeInterception } = require("geo-hunter");

const target = {
  coord_x: 30.52,   // Longitude of the target
  coord_y: 50.45,   // Latitude of the target
  coord_z: 10000,   // Altitude of the target in meters
  crs_xy: 90,       // Direction of movement (in degrees)
  speed: 900        // Speed of the target (km/h)
};

const interceptor = {
  lon: 31.0,        // Longitude of the interceptor
  lat: 50.0,        // Latitude of the interceptor
  max_speed: 1200,  // Maximum speed (km/h)
  cruise_speed: 900,// Cruise speed (km/h)
  max_distance: 500 // Operational range (km)
};

const result = makeInterception(target, interceptor);

if (result.point) {
  console.log(`Interception Point: longitude ${result.point.lon}, latitude ${result.point.lat}`);
  console.log(`Steps to intercept: ${result.steps}`);
  console.log(`Interception Probability: ${result.interceptedPercent}%`);
} else {
  console.log("The target cannot be intercepted under the current conditions.");
}

Example: Calculating the Interception Point (TypeScript)

import { makeInterception, Target, Interceptor } from "geo-hunter";

const target: Target = {
  coord_x: 30.52,   // Longitude of the target
  coord_y: 50.45,   // Latitude of the target
  coord_z: 10000,   // Altitude of the target in meters
  crs_xy: 90,       // Direction of movement (in degrees)
  speed: 900        // Speed of the target (km/h)
};

const interceptor: Interceptor = {
  lon: 31.0,        // Longitude of the interceptor
  lat: 50.0,        // Latitude of the interceptor
  max_speed: 1200,  // Maximum speed (km/h)
  cruise_speed: 900,// Cruise speed (km/h)
  max_distance: 500 // Operational range (km)
};

const result = makeInterception(target, interceptor);

if (result.point) {
  console.log(`Interception Point: longitude ${result.point.lon}, latitude ${result.point.lat}`);
  console.log(`Steps to intercept: ${result.steps}`);
  console.log(`Interception Probability: ${result.interceptedPercent}%`);
} else {
  console.log("The target cannot be intercepted under the current conditions.");
}

Parameters Table

ParameterTypeDescriptionRequired
coord_xnumberLongitude of the target (in degrees, EPSG:4326).Yes
coord_ynumberLatitude of the target (in degrees, EPSG:4326).Yes
coord_znumberAltitude of the target (in meters).Yes
crs_xynumberDirection of the target's movement (in degrees, 0-360).Yes
speednumberSpeed of the target (in km/h).Yes
lonnumberLongitude of the interceptor (in degrees, EPSG:4326).Yes
latnumberLatitude of the interceptor (in degrees, EPSG:4326).Yes
max_speednumberMaximum speed of the interceptor (in km/h).Yes
cruise_speednumberCruise speed of the interceptor (in km/h).Yes
max_distancenumberOperational range of the interceptor (in km).Yes
pointobject or nullCoordinates of the interception point ({ lon: number, lat: number }) or null if not interceptable.No
stepsnumberNumber of steps required to reach the interception point.No
interceptedPercentnumber or undefinedProbability of successful interception (percentage).No

Data Types Table

TypePropertiesDescription
Targetcoord_x: number
coord_y: number
coord_z: number
crs_xy: number
speed: number
Represents the target's coordinates, speed, and movement direction.
Interceptorlon: number
lat: number
max_speed: number
cruise_speed: number
max_distance: number
Represents the interceptor's position, speed, and range.
InterceptionResult`point: { lon: number, lat: number }null<br>steps: number<br>interceptedPercent?: number`

Keywords

geo

FAQs

Package last updated on 30 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts