UNPKG
@xtor/cga.js
Version:
latest (0.0.6)
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
Xtor Compute Geometry Algorithm Libary 计算几何算法库
github.com/yszhao91/cga.js
yszhao91/cga.js
@xtor/cga.js
/
src
/
alg
/
sort.ts
12 lines
(11 loc)
•
282 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
import
{
Vec3
}
from
'../math/Vec3'
;
export
function
vectorCompare
(
a: Vec3, b: Vec3
) {
if
(a.
x
=== b.
x
) {
if
(a.
z
!==
undefined
&& a.
y
=== b.
y
)
return
a.
z
- b.
z
else
return
a.
y
- b.
y
; }
else
return
a.
x
- b.
x
; }