ansel0926
2022-05-18 f0efddd9e32b9c5dc828401c4092be004b4826cf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
var P = {version: "1.0.0"}
P.PlotUtils = {}, P.PlotUtils.distance = function(t, o) {
    return Math.sqrt(Math.pow(t[0] - o[0], 2) + Math.pow(t[1] - o[1], 2))
}, P.PlotUtils.wholeDistance = function(t) {
    for (var o = 0, e = 0; e < t.length - 1; e++) o += P.PlotUtils.distance(t[e], t[e + 1]);
    return o
}, P.PlotUtils.getBaseLength = function(t) {
    return Math.pow(P.PlotUtils.wholeDistance(t), .99)
}, P.PlotUtils.mid = function(t, o) {
    return [(t[0] + o[0]) / 2, (t[1] + o[1]) / 2]
}, P.PlotUtils.getCircleCenterOfThreePoints = function(t, o, e) {
    var r = [(t[0] + o[0]) / 2, (t[1] + o[1]) / 2],
        n = [r[0] - t[1] + o[1], r[1] + t[0] - o[0]],
        g = [(t[0] + e[0]) / 2, (t[1] + e[1]) / 2],
        i = [g[0] - t[1] + e[1], g[1] + t[0] - e[0]];
    return P.PlotUtils.getIntersectPoint(r, n, g, i)
}, P.PlotUtils.getIntersectPoint = function(t, o, e, r) {
    if (t[1] == o[1]) {
        var n = (r[0] - e[0]) / (r[1] - e[1]),
            g = n * (t[1] - e[1]) + e[0],
            i = t[1];
        return [g, i]
    }
    if (e[1] == r[1]) {
        var s = (o[0] - t[0]) / (o[1] - t[1]);
        return g = s * (e[1] - t[1]) + t[0], i = e[1], [g, i]
    }
    return s = (o[0] - t[0]) / (o[1] - t[1]), n = (r[0] - e[0]) / (r[1] - e[1]), i = (s * t[1] - t[0] - n * e[1] + e[0]) / (s - n), g = s * i - s * t[1] + t[0], [g, i]
}, P.PlotUtils.getAzimuth = function(t, o) {
    var e, r = Math.asin(Math.abs(o[1] - t[1]) / P.PlotUtils.distance(t, o));
    return o[1] >= t[1] && o[0] >= t[0] ? e = r + Math.PI : o[1] >= t[1] && o[0] < t[0] ? e = P.Constants.TWO_PI - r : o[1] < t[1] && o[0] < t[0] ? e = r : o[1] < t[1] && o[0] >= t[0] && (e = Math.PI - r), e
}, P.PlotUtils.getAngleOfThreePoints = function(t, o, e) {
    var r = P.PlotUtils.getAzimuth(o, t) - P.PlotUtils.getAzimuth(o, e);
    return 0 > r ? r + P.Constants.TWO_PI : r
}, P.PlotUtils.isClockWise = function(t, o, e) {
    return (e[1] - t[1]) * (o[0] - t[0]) > (o[1] - t[1]) * (e[0] - t[0])
}, P.PlotUtils.getPointOnLine = function(t, o, e) {
    var r = o[0] + t * (e[0] - o[0]),
        n = o[1] + t * (e[1] - o[1]);
    return [r, n]
}, P.PlotUtils.getCubicValue = function(t, o, e, r, n) {
    t = Math.max(Math.min(t, 1), 0);
    var g = 1 - t,
        i = t * t,
        s = i * t,
        a = g * g,
        l = a * g,
        u = l * o[0] + 3 * a * t * e[0] + 3 * g * i * r[0] + s * n[0],
        c = l * o[1] + 3 * a * t * e[1] + 3 * g * i * r[1] + s * n[1];
    return [u, c]
}, P.PlotUtils.getThirdPoint = function(t, o, e, r, n) {
    var g = P.PlotUtils.getAzimuth(t, o),
        i = n ? g + e : g - e,
        s = r * Math.cos(i),
        a = r * Math.sin(i);
    return [o[0] + s, o[1] + a]
}, P.PlotUtils.getArcPoints = function(t, o, e, r) {
    var n, g, i = [],
        s = r - e;
    s = 0 > s ? s + P.Constants.TWO_PI : s;
    for (var a = 0; a <= P.Constants.FITTING_COUNT; a++) {
        var l = e + s * a / P.Constants.FITTING_COUNT;
        n = t[0] + o * Math.cos(l), g = t[1] + o * Math.sin(l), i.push([n, g])
    }
    return i
}, P.PlotUtils.getBisectorNormals = function(t, o, e, r) {
    var n = P.PlotUtils.getNormal(o, e, r),
        g = Math.sqrt(n[0] * n[0] + n[1] * n[1]),
        i = n[0] / g,
        s = n[1] / g,
        a = P.PlotUtils.distance(o, e),
        l = P.PlotUtils.distance(e, r);
    if (g > P.Constants.ZERO_TOLERANCE) if (P.PlotUtils.isClockWise(o, e, r)) {
        var u = t * a,
            c = e[0] - u * s,
            p = e[1] + u * i,
            h = [c, p];
        u = t * l, c = e[0] + u * s, p = e[1] - u * i;
        var d = [c, p]
    } else u = t * a, c = e[0] + u * s, p = e[1] - u * i, h = [c, p], u = t * l, c = e[0] - u * s, p = e[1] + u * i, d = [c, p];
    else c = e[0] + t * (o[0] - e[0]), p = e[1] + t * (o[1] - e[1]), h = [c, p], c = e[0] + t * (r[0] - e[0]), p = e[1] + t * (r[1] - e[1]), d = [c, p];
    return [h, d]
}, P.PlotUtils.getNormal = function(t, o, e) {
    var r = t[0] - o[0],
        n = t[1] - o[1],
        g = Math.sqrt(r * r + n * n);
    r /= g, n /= g;
    var i = e[0] - o[0],
        s = e[1] - o[1],
        a = Math.sqrt(i * i + s * s);
    i /= a, s /= a;
    var l = r + i,
        u = n + s;
    return [l, u]
}, P.PlotUtils.getCurvePoints = function(t, o) {
    for (var e = P.PlotUtils.getLeftMostControlPoint(o), r = [e], n = 0; n < o.length - 2; n++) {
        var g = o[n],
            i = o[n + 1],
            s = o[n + 2],
            a = P.PlotUtils.getBisectorNormals(t, g, i, s);
        r = r.concat(a)
    }
    var l = P.PlotUtils.getRightMostControlPoint(o);
    r.push(l);
    var u = [];
    for (n = 0; n < o.length - 1; n++) {
        g = o[n], i = o[n + 1], u.push(g);
        for (var t = 0; t < P.Constants.FITTING_COUNT; t++) {
            var c = P.PlotUtils.getCubicValue(t / P.Constants.FITTING_COUNT, g, r[2 * n], r[2 * n + 1], i);
            u.push(c)
        }
        u.push(i)
    }
    return u
}, P.PlotUtils.getLeftMostControlPoint = function(o) {
    var e = o[0],
        r = o[1],
        n = o[2],
        g = P.PlotUtils.getBisectorNormals(0, e, r, n),
        i = g[0],
        s = P.PlotUtils.getNormal(e, r, n),
        a = Math.sqrt(s[0] * s[0] + s[1] * s[1]);
    if (a > P.Constants.ZERO_TOLERANCE) var l = P.PlotUtils.mid(e, r),
        u = e[0] - l[0],
        c = e[1] - l[1],
        p = P.PlotUtils.distance(e, r),
        h = 2 / p,
        d = -h * c,
        f = h * u,
        E = d * d - f * f,
        v = 2 * d * f,
        A = f * f - d * d,
        _ = i[0] - l[0],
        y = i[1] - l[1],
        m = l[0] + E * _ + v * y,
        O = l[1] + v * _ + A * y;
    else m = e[0] + t * (r[0] - e[0]), O = e[1] + t * (r[1] - e[1]);
    return [m, O]
}, P.PlotUtils.getRightMostControlPoint = function(o) {
    var e = o.length,
        r = o[e - 3],
        n = o[e - 2],
        g = o[e - 1],
        i = P.PlotUtils.getBisectorNormals(0, r, n, g),
        s = i[1],
        a = P.PlotUtils.getNormal(r, n, g),
        l = Math.sqrt(a[0] * a[0] + a[1] * a[1]);
    if (l > P.Constants.ZERO_TOLERANCE) var u = P.PlotUtils.mid(n, g),
        c = g[0] - u[0],
        p = g[1] - u[1],
        h = P.PlotUtils.distance(n, g),
        d = 2 / h,
        f = -d * p,
        E = d * c,
        v = f * f - E * E,
        A = 2 * f * E,
        _ = E * E - f * f,
        y = s[0] - u[0],
        m = s[1] - u[1],
        O = u[0] + v * y + A * m,
        T = u[1] + A * y + _ * m;
    else O = g[0] + t * (n[0] - g[0]), T = g[1] + t * (n[1] - g[1]);
    return [O, T]
}, P.PlotUtils.getBezierPoints = function(t) {
    if (t.length <= 2) return t;
    for (var o = [], e = t.length - 1, r = 0; 1 >= r; r += .01) {
        for (var n = y = 0, g = 0; e >= g; g++) {
            var i = P.PlotUtils.getBinomialFactor(e, g),
                s = Math.pow(r, g),
                a = Math.pow(1 - r, e - g);
            n += i * s * a * t[g][0], y += i * s * a * t[g][1]
        }
        o.push([n, y])
    }
    return o.push(t[e]), o
}, P.PlotUtils.getBinomialFactor = function(t, o) {
    return P.PlotUtils.getFactorial(t) / (P.PlotUtils.getFactorial(o) * P.PlotUtils.getFactorial(t - o))
}, P.PlotUtils.getFactorial = function(t) {
    if (1 >= t) return 1;
    if (2 == t) return 2;
    if (3 == t) return 6;
    if (4 == t) return 24;
    if (5 == t) return 120;
    for (var o = 1, e = 1; t >= e; e++) o *= e;
    return o
}, P.PlotUtils.getQBSplinePoints = function(t) {
    if (t.length <= 2) return t;
    var o = 2,
        e = [],
        r = t.length - o - 1;
    e.push(t[0]);
    for (var n = 0; r >= n; n++) for (var g = 0; 1 >= g; g += .05) {
        for (var i = y = 0, s = 0; o >= s; s++) {
            var a = P.PlotUtils.getQuadricBSplineFactor(s, g);
            i += a * t[n + s][0], y += a * t[n + s][1]
        }
        e.push([i, y])
    }
    return e.push(t[t.length - 1]), e
}, P.PlotUtils.getQuadricBSplineFactor = function(t, o) {
    return 0 == t ? Math.pow(o - 1, 2) / 2 : 1 == t ? (-2 * Math.pow(o, 2) + 2 * o + 1) / 2 : 2 == t ? Math.pow(o, 2) / 2 : 0
},P.Constants = {
    TWO_PI: 2 * Math.PI,
    HALF_PI: Math.PI / 2,
    FITTING_COUNT: 100,
    ZERO_TOLERANCE: 1e-4
}
 
var xp = {
    version: "1.0.0",
    createTime: "2018.6.19",
    author: "xupinhui"
}
var doubleArrowDefualParam = {
    type: "doublearrow",
    headHeightFactor: .25,
    headWidthFactor: .3,
    neckHeightFactor: .85,
    fixPointCount: 4,
    neckWidthFactor: .15
}
var tailedAttackArrowDefualParam = {
    headHeightFactor: .18,
    headWidthFactor: .3,
    neckHeightFactor: .85,
    neckWidthFactor: .15,
    tailWidthFactor: .1,
    headTailFactor: .8,
    swallowTailFactor: 1
};
var fineArrowDefualParam = {
    tailWidthFactor: 0.15,
    neckWidthFactor: 0.20,
    headWidthFactor: 0.25,
    headAngle: Math.PI / 8.5,
    neckAngle: Math.PI / 13
};
xp.algorithm = {},
xp.algorithm.doubleArrow = function (inputPoint) {
    this.connPoint = null;
    this.tempPoint4 = null;
    this.points = inputPoint;
    var result = {
        controlPoint: null,
        polygonalPoint: null
    };
    //获取已经点击的坐标数
    var t = inputPoint.length;
    if (!(2 > t)) {
        if (2 == t) return inputPoint;
        var o = this.points[0],    //第一个点
        e = this.points[1],        //第二个点
        r = this.points[2],        //第三个点
        t = inputPoint.length; //获取已经点击的坐标数
        //下面的是移动点位后的坐标
        3 == t ? this.tempPoint4 = xp.algorithm.getTempPoint4(o, e, r) : this.tempPoint4 = this.points[3],
        3 == t || 4 == t ? this.connPoint = P.PlotUtils.mid(o, e) : this.connPoint = this.points[4];
        var n, g;
        P.PlotUtils.isClockWise(o, e, r) ? (n = xp.algorithm.getArrowPoints(o, this.connPoint, this.tempPoint4, !1), g = xp.algorithm.getArrowPoints(this.connPoint, e, r, !0)) : (n = xp.algorithm.getArrowPoints(e, this.connPoint, r, !1), g = xp.algorithm.getArrowPoints(this.connPoint, o, this.tempPoint4, !0));
        var i = n.length,
        s = (i - 5) / 2,
        a = n.slice(0, s),
        l = n.slice(s, s + 5),
        u = n.slice(s + 5, i),
        c = g.slice(0, s),
        p = g.slice(s, s + 5),
        h = g.slice(s + 5, i);
        c = P.PlotUtils.getBezierPoints(c);
        var d = P.PlotUtils.getBezierPoints(h.concat(a.slice(1)));
        u = P.PlotUtils.getBezierPoints(u);
        var f = c.concat(p, d, l, u);
        var newArray = xp.algorithm.array2Dto1D(f);
        result.controlPoint = [o, e, r, this.tempPoint4, this.connPoint];
        result.polygonalPoint = Cesium.Cartesian3.fromDegreesArray(newArray);
    }
    return result;
},
xp.algorithm.threeArrow = function (inputPoint) {
    this.connPoint = null;
    this.tempPoint4 = null;
    this.tempPoint5 = null;
    this.points = inputPoint;
    var result = {
        controlPoint: null,
        polygonalPoint: null
    };
    //获取已经点击的坐标数
    var t = inputPoint.length;
    if (t >= 2) {
        if (t == 2) {
            return inputPoint;
        }
        var o = this.points[0],    //第一个点
        e = this.points[1],        //第二个点
        r = this.points[2],        //第三个点
        t = inputPoint.length; //获取已经点击的坐标数
        //下面的是移动点位后的坐标
        if (t == 3) {
            this.tempPoint4 = xp.algorithm.getTempPoint4(o, e, r);
            this.tempPoint5 = P.PlotUtils.mid(r, this.tempPoint4);
        } else {
            this.tempPoint4 = this.points[3];
            this.tempPoint5 = this.points[4];
        }
        if (t < 6) {
            this.connPoint = P.PlotUtils.mid(o, e);
        } else {
            this.connPoint = this.points[5];
        }
        var n, g;
        if (P.PlotUtils.isClockWise(o, e, r)) {
            n = xp.algorithm.getArrowPoints(o, this.connPoint, this.tempPoint4, !1);
            g = xp.algorithm.getArrowPoints(this.connPoint, e, r, !0);
        } else {
            n = xp.algorithm.getArrowPoints(e, this.connPoint, r, !1);
            g = xp.algorithm.getArrowPoints(this.connPoint, o, this.tempPoint4, !0);
        }
        var i = n.length,
        s = (i - 5) / 2,
        a = n.slice(0, s),
        l = n.slice(s, s + 5),
        u = n.slice(s + 5, i),
        c = g.slice(0, s),
        p = g.slice(s, s + 5),
        h = g.slice(s + 5, i);
        c = P.PlotUtils.getBezierPoints(c);
        var d = P.PlotUtils.getBezierPoints(h.concat(a.slice(1)));
        u = P.PlotUtils.getBezierPoints(u);
        var f = c.concat(p, d, l, u);
        var newArray = xp.algorithm.array2Dto1D(f);
        result.controlPoint = [o, e, r, this.tempPoint4, this.tempPoint5, this.connPoint];
        result.polygonalPoint = Cesium.Cartesian3.fromDegreesArray(newArray);
    }
    return result;
},
xp.algorithm.array2Dto1D = function (array) {
    var newArray = [];
    array.forEach(function (elt) {
        newArray.push(elt[0]);
        newArray.push(elt[1]);
    });
    return newArray;
},
xp.algorithm.getArrowPoints = function (t, o, e, r) {
    this.type = doubleArrowDefualParam.type,
    this.headHeightFactor = doubleArrowDefualParam.headHeightFactor,
    this.headWidthFactor = doubleArrowDefualParam.headWidthFactor,
    this.neckHeightFactor = doubleArrowDefualParam.neckHeightFactor,
    this.neckWidthFactor = doubleArrowDefualParam.neckWidthFactor;
    var n = P.PlotUtils.mid(t, o),
    g = P.PlotUtils.distance(n, e),
    i = P.PlotUtils.getThirdPoint(e, n, 0, .3 * g, !0),
    s = P.PlotUtils.getThirdPoint(e, n, 0, .5 * g, !0);
    i = P.PlotUtils.getThirdPoint(n, i, P.Constants.HALF_PI, g / 5, r),
    s = P.PlotUtils.getThirdPoint(n, s, P.Constants.HALF_PI, g / 4, r);
    var a = [n, i, s, e],
    l = xp.algorithm.getArrowHeadPoints(a, this.headHeightFactor, this.headWidthFactor, this.neckHeightFactor, this.neckWidthFactor),
    u = l[0],
    c = l[4],
    p = P.PlotUtils.distance(t, o) / P.PlotUtils.getBaseLength(a) / 2,
    h = xp.algorithm.getArrowBodyPoints(a, u, c, p),
    d = h.length,
    f = h.slice(0, d / 2),
    E = h.slice(d / 2, d);
    return f.push(u),
    E.push(c),
    f = f.reverse(),
    f.push(o),
    E = E.reverse(),
    E.push(t),
    f.reverse().concat(l, E)
},
xp.algorithm.getArrowHeadPoints = function (t, o, e) {
    this.type = doubleArrowDefualParam.type,
    this.headHeightFactor = doubleArrowDefualParam.headHeightFactor,
    this.headWidthFactor = doubleArrowDefualParam.headWidthFactor,
    this.neckHeightFactor = doubleArrowDefualParam.neckHeightFactor,
    this.neckWidthFactor = doubleArrowDefualParam.neckWidthFactor;
    var r = P.PlotUtils.getBaseLength(t),
    n = r * this.headHeightFactor,
    g = t[t.length - 1],
    i = (P.PlotUtils.distance(o, e), n * this.headWidthFactor),
    s = n * this.neckWidthFactor,
    a = n * this.neckHeightFactor,
    l = P.PlotUtils.getThirdPoint(t[t.length - 2], g, 0, n, !0),
    u = P.PlotUtils.getThirdPoint(t[t.length - 2], g, 0, a, !0),
    c = P.PlotUtils.getThirdPoint(g, l, P.Constants.HALF_PI, i, !1),
    p = P.PlotUtils.getThirdPoint(g, l, P.Constants.HALF_PI, i, !0),
    h = P.PlotUtils.getThirdPoint(g, u, P.Constants.HALF_PI, s, !1),
    d = P.PlotUtils.getThirdPoint(g, u, P.Constants.HALF_PI, s, !0);
    return [h, c, g, p, d];
},
xp.algorithm.getArrowBodyPoints = function (t, o, e, r) {
    for (var n = P.PlotUtils.wholeDistance(t), g = P.PlotUtils.getBaseLength(t), i = g * r, s = P.PlotUtils.distance(o, e), a = (i - s) / 2, l = 0, u = [], c = [], p = 1; p < t.length - 1; p++) {
        var h = P.PlotUtils.getAngleOfThreePoints(t[p - 1], t[p], t[p + 1]) / 2;
        l += P.PlotUtils.distance(t[p - 1], t[p]);
        var d = (i / 2 - l / n * a) / Math.sin(h),
        f = P.PlotUtils.getThirdPoint(t[p - 1], t[p], Math.PI - h, d, !0),
        E = P.PlotUtils.getThirdPoint(t[p - 1], t[p], h, d, !1);
        u.push(f),
        c.push(E)
    }
    return u.concat(c)
},
xp.algorithm.getTempPoint4 = function (t, o, e) {
    var r, n, g, i, s = P.PlotUtils.mid(t, o),
    a = P.PlotUtils.distance(s, e),
    l = P.PlotUtils.getAngleOfThreePoints(t, s, e);
    return l < P.Constants.HALF_PI ? (n = a * Math.sin(l), g = a * Math.cos(l), i = P.PlotUtils.getThirdPoint(t, s, P.Constants.HALF_PI, n, !1), r = P.PlotUtils.getThirdPoint(s, i, P.Constants.HALF_PI, g, !0)) : l >= P.Constants.HALF_PI && l < Math.PI ? (n = a * Math.sin(Math.PI - l), g = a * Math.cos(Math.PI - l), i = P.PlotUtils.getThirdPoint(t, s, P.Constants.HALF_PI, n, !1), r = P.PlotUtils.getThirdPoint(s, i, P.Constants.HALF_PI, g, !1)) : l >= Math.PI && l < 1.5 * Math.PI ? (n = a * Math.sin(l - Math.PI), g = a * Math.cos(l - Math.PI), i = P.PlotUtils.getThirdPoint(t, s, P.Constants.HALF_PI, n, !0), r = P.PlotUtils.getThirdPoint(s, i, P.Constants.HALF_PI, g, !0)) : (n = a * Math.sin(2 * Math.PI - l), g = a * Math.cos(2 * Math.PI - l), i = P.PlotUtils.getThirdPoint(t, s, P.Constants.HALF_PI, n, !0), r = P.PlotUtils.getThirdPoint(s, i, P.Constants.HALF_PI, g, !1)),
    r
},
xp.algorithm.tailedAttackArrow = function (inputPoint) {
    inputPoint = xp.algorithm.dereplication(inputPoint);
    this.tailWidthFactor = tailedAttackArrowDefualParam.tailWidthFactor;
    this.swallowTailFactor = tailedAttackArrowDefualParam.swallowTailFactor;
    this.swallowTailPnt = tailedAttackArrowDefualParam.swallowTailPnt;
    //控制点
    var result = {
        controlPoint: null,
        polygonalPoint: null
    };
    result.controlPoint = inputPoint;
    var t = inputPoint.length;
    if (!(2 > t)) {
        if (2 == inputPoint.length) {
            result.polygonalPoint = inputPoint;
            return result;
        }
        var o = inputPoint,
        e = o[0],
        r = o[1];
        P.PlotUtils.isClockWise(o[0], o[1], o[2]) && (e = o[1], r = o[0]);
        var n = P.PlotUtils.mid(e, r),
        g = [n].concat(o.slice(2)),
        i = xp.algorithm.getAttackArrowHeadPoints(g, e, r, tailedAttackArrowDefualParam),
        s = i[0],
        a = i[4],
        l = P.PlotUtils.distance(e, r),
        u = P.PlotUtils.getBaseLength(g),
        c = u * this.tailWidthFactor * this.swallowTailFactor;
        this.swallowTailPnt = P.PlotUtils.getThirdPoint(g[1], g[0], 0, c, !0);
        var p = l / u,
        h = xp.algorithm.getAttackArrowBodyPoints(g, s, a, p),
        t = h.length,
        d = [e].concat(h.slice(0, t / 2));
        d.push(s);
        var f = [r].concat(h.slice(t / 2, t));
        var newArray = [];
        f.push(a),
        d = P.PlotUtils.getQBSplinePoints(d),
        f = P.PlotUtils.getQBSplinePoints(f),
        newArray = xp.algorithm.array2Dto1D(d.concat(i, f.reverse(), [this.swallowTailPnt, d[0]]));
        result.polygonalPoint = Cesium.Cartesian3.fromDegreesArray(newArray);
    }
    return result;
},
xp.algorithm.getAttackArrowHeadPoints = function (t, o, e, defaultParam) {
    this.headHeightFactor = defaultParam.headHeightFactor;
    this.headTailFactor = defaultParam.headTailFactor;
    this.headWidthFactor = defaultParam.headWidthFactor;
    this.neckWidthFactor = defaultParam.neckWidthFactor;
    this.neckHeightFactor = defaultParam.neckHeightFactor;
    var r = P.PlotUtils.getBaseLength(t),
    n = r * this.headHeightFactor,
    g = t[t.length - 1];
    r = P.PlotUtils.distance(g, t[t.length - 2]);
    var i = P.PlotUtils.distance(o, e);
    n > i * this.headTailFactor && (n = i * this.headTailFactor);
    var s = n * this.headWidthFactor,
    a = n * this.neckWidthFactor;
    n = n > r ? r : n;
    var l = n * this.neckHeightFactor,
    u = P.PlotUtils.getThirdPoint(t[t.length - 2], g, 0, n, !0),
    c = P.PlotUtils.getThirdPoint(t[t.length - 2], g, 0, l, !0),
    p = P.PlotUtils.getThirdPoint(g, u, P.Constants.HALF_PI, s, !1),
    h = P.PlotUtils.getThirdPoint(g, u, P.Constants.HALF_PI, s, !0),
    d = P.PlotUtils.getThirdPoint(g, c, P.Constants.HALF_PI, a, !1),
    f = P.PlotUtils.getThirdPoint(g, c, P.Constants.HALF_PI, a, !0);
    return [d, p, g, h, f]
},
xp.algorithm.getAttackArrowBodyPoints = function (t, o, e, r) {
    for (var n = P.PlotUtils.wholeDistance(t), g = P.PlotUtils.getBaseLength(t), i = g * r, s = P.PlotUtils.distance(o, e), a = (i - s) / 2, l = 0, u = [], c = [], p = 1; p < t.length - 1; p++) {
        var h = P.PlotUtils.getAngleOfThreePoints(t[p - 1], t[p], t[p + 1]) / 2;
        l += P.PlotUtils.distance(t[p - 1], t[p]);
        var d = (i / 2 - l / n * a) / Math.sin(h),
        f = P.PlotUtils.getThirdPoint(t[p - 1], t[p], Math.PI - h, d, !0),
        E = P.PlotUtils.getThirdPoint(t[p - 1], t[p], h, d, !1);
        u.push(f),
        c.push(E)
    }
    return u.concat(c)
},
xp.algorithm.dereplication = function (array) {
    var last = array[array.length - 1];
    var change = false;
    var newArray = [];
    newArray = array.filter(function (i) {
        if (i[0] != last[0] && i[1] != last[1]) {
            return i;
        }
        change = true;
    });
    if (change) newArray.push(last);
    return newArray;
},
xp.algorithm.fineArrow = function (tailPoint, headerPoint) {
    if ((tailPoint.length < 2) || (headerPoint.length < 2)) return;
    //画箭头的函数
    let tailWidthFactor = fineArrowDefualParam.tailWidthFactor;
    let neckWidthFactor = fineArrowDefualParam.neckWidthFactor;
    let headWidthFactor = fineArrowDefualParam.headWidthFactor;
    let headAngle = fineArrowDefualParam.headAngle;
    let neckAngle = fineArrowDefualParam.neckAngle;
    var o = [];
    o[0] = tailPoint;
    o[1] = headerPoint;
    e = o[0],
    r = o[1],
    n = P.PlotUtils.getBaseLength(o),
    g = n * tailWidthFactor,
    //尾部宽度因子
    i = n * neckWidthFactor,
    //脖子宽度银子
    s = n * headWidthFactor,
    //头部宽度因子
    a = P.PlotUtils.getThirdPoint(r, e, P.Constants.HALF_PI, g, !0),
    l = P.PlotUtils.getThirdPoint(r, e, P.Constants.HALF_PI, g, !1),
    u = P.PlotUtils.getThirdPoint(e, r, headAngle, s, !1),
    c = P.PlotUtils.getThirdPoint(e, r, headAngle, s, !0),
    p = P.PlotUtils.getThirdPoint(e, r, neckAngle, i, !1),
    h = P.PlotUtils.getThirdPoint(e, r, neckAngle, i, !0),
    d = [];
    d.push(a[0], a[1], p[0], p[1], u[0], u[1], r[0], r[1], c[0], c[1], h[0], h[1], l[0], l[1], e[0], e[1]);
    return Cesium.Cartesian3.fromDegreesArray(d);
}