UNPKG
3dmol
Version:
latest (2.5.2)
2.5.2
2.5.1
2.5.0
2.4.2
2.4.1
2.4.0
2.3.0
2.2.1
2.2.1-post1
2.2.0
2.1.0
2.0.6
2.0.5
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0
1.8.0
1.7.1
1.7.0
1.6.4
1.6.3
1.6.2
1.6.1
1.6.0
1.5.4
1.5.3
1.5.1
1.5.0
1.4.0
1.3.7
1.3.6
1.3.5
1.3.4
1.3.3
1.3.2
1.3.1
1.3.0
1.1.4
1.1.3
1.1.2
1.1.1
1.0.10
1.0.9
1.0.8
1.0.7
1.0.6
JavaScript/TypeScript molecular visualization library
3dmol.org
3dmol/3Dmol.js
3dmol
/
src
/
WebGL
/
math
/
utils
/
clamp.ts
7 lines
•
168 B
text/typescript
View Raw
1
2
3
4
5
6
7
/* * math-like functionality * quaternion, vector, matrix */
export
function
clamp
(
x
:
number
,
min
:
number
,
max
:
number
) {
return
Math
.
min
(
Math
.
max
(x, min), max); }