MCPcopy
hub / github.com/apache/echarts / pointEquals

Function pointEquals

test/ut/spec/api/converter.test.ts:30–40  ·  view source on GitHub ↗
(p1: number | number[], p2: number | number[])

Source from the content-addressed store, hash-verified

28 const DELTA = 1E-3;
29
30 function pointEquals(p1: number | number[], p2: number | number[]): boolean {
31 if (p1 instanceof Array && p2 instanceof Array) {
32 return Math.abs(p1[0] - p2[0]) < DELTA && Math.abs(p1[1] - p2[1]) < DELTA;
33 }
34 else if (typeof p1 === 'number' && typeof p2 === 'number') {
35 return Math.abs(p1 - p2) < DELTA;
36 }
37 else {
38 throw Error('Iillegal p1 or p2');
39 }
40 }
41
42 const testGeoJson1: GeoJSON = {
43 'type': 'FeatureCollection',

Callers 1

converter.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…