Gathering detailed insights and metrics for @twpayne/xcscore
Gathering detailed insights and metrics for @twpayne/xcscore
Gathering detailed insights and metrics for @twpayne/xcscore
Gathering detailed insights and metrics for @twpayne/xcscore
npm install @twpayne/xcscore
Typescript
Module System
Node Version
NPM Version
76
Supply Chain
97.2
Quality
75.3
Maintenance
100
Vulnerability
100
License
TypeScript (99.9%)
JavaScript (0.1%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2 Stars
57 Commits
2 Watchers
1 Branches
2 Contributors
Updated on Jul 22, 2024
Latest Version
1.0.3
Package Id
@twpayne/xcscore@1.0.3
Unpacked Size
363.49 kB
Size
85.79 kB
File Count
30
NPM Version
6.14.4
Node Version
13.12.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Cross country league flight scoring for paragliding.
xcscore computes the highest scoring flight from an array of coords according to the World XContest and Swiss Cross Country Cup rules. It is designed for use in XC flight planning software like XC Planner. It uses crude brute force algorithms that support only a small number of coordinates and is not suitable for scoring flights from GPS tracklogs.
xcscore exports two functions:
scoreWorldXContest
for scoring flights according to the World XContest
rules.scoreCHCrossCountryCup
for scoring flights according to the Swiss Cross
Country Cup rules.Each function takes a single object as an argument with two properties:
coords
: an array of coordinates.distKMFunc
: a function that returns the distance in kilometers between two
coordinates.Each function returns a single object describing the highest scoring flight found with five properties:
flightType
: the type of the flight, e.g. "openDist"
, "flatTri"
, or
"faiTri"
. For a full list of flight types see the documentation.dist
: the scoring distance of the flight.multiplier
: the scoring multiplier for the type of flight.score
: the score of the flight. Note that this is not necessarily equal to
the product of dist
and multiplier
due to rounding rules.coords
: the coordinates of the start, up to three turnpoints, and end of the
scoring part of the flight.If no scoring flight can be found (e.g. because there are fewer than two input
coords) then the returned object will have flightType
"none"
, dist
,
multiplier
, and score
0
, and coords
[]
.
For a full description of the API, consult the documentation in the dist/docs
directory.
xcscore uses simple brute force algorithms for implementation simplicity and minimal code size. CPU usage increases with O(N^5) and memory usage with O(N^2) so xscore is heavily CPU bound.
The package includes benchmarks to measure performance, the results of which depend heavily on the CPU. As a rough guide, 25 coords is fine on any machine (scored in approximately less than 2ms on a single core of a 2014-era MacBook Pro), whereas 50 coords is a reasonable upper limit (taking 60ms on the same machine).
More sophisticated algorithms are used for scoring real GPS tracklogs with tens of thousands of points. Contact the author for details.
xcscore is independent of the coordinate format and the function to compute the distance between two coordinates. As such, it can be used with any mapping library.
coords
can be an array of google.maps.LatLng
s and you can use the following
function as distKMFunc
:
1function distKM(latLng1, latLng2) { 2 return google.maps.geometry.spherical.computeDistanceBetween(latLng1, latLng2, 6371); 3}
coords
can be an array of LatLng
s and you can use the following function as
distKMFunc
:
1function distKM(latLng1, latLng2) { 2 return latLng1.distanceTo(latLng2)/1000; 3}
MIT
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
Found 2/15 approved changesets -- score normalized to 1
Reason
project is archived
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
30 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More