Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / java / lang / StrictMath.js
1 Clazz.load(null,"java.lang.StrictMath",["java.lang.Double","$.Float"],function(){
2 c$=Clazz.declareType(java.lang,"StrictMath");
3 c$.abs=Clazz.defineMethod(c$,"abs",
4 function(d){
5 return Math.abs(d);
6 },"~N");
7 c$.acos=Clazz.defineMethod(c$,"acos",
8 function(d){
9 return Math.acos(d);
10 },"~N");
11 c$.asin=Clazz.defineMethod(c$,"asin",
12 function(d){
13 return Math.asin(d);
14 },"~N");
15 c$.atan=Clazz.defineMethod(c$,"atan",
16 function(d){
17 return Math.atan(d);
18 },"~N");
19 c$.atan2=Clazz.defineMethod(c$,"atan2",
20 function(d1,d2){
21 return Math.atan2(d1,d2);
22 },"~N,~N");
23 c$.ceil=Clazz.defineMethod(c$,"ceil",
24 function(d){
25 return Math.ceil(d);
26 },"~N");
27 c$.cosh=Clazz.defineMethod(c$,"cosh",
28 function(d){
29 return Math.cosh(d);
30 },"~N");
31 c$.cos=Clazz.defineMethod(c$,"cos",
32 function(d){
33 return Math.cos(d);
34 },"~N");
35 c$.exp=Clazz.defineMethod(c$,"exp",
36 function(d){
37 return Math.exp(d);
38 },"~N");
39 c$.floor=Clazz.defineMethod(c$,"floor",
40 function(d){
41 return Math.floor(d);
42 },"~N");
43 c$.log=Clazz.defineMethod(c$,"log",
44 function(d){
45 return Math.log(d);
46 },"~N");
47 c$.log10=Clazz.defineMethod(c$,"log10",
48 function(d){
49 return Math.log10(d);
50 },"~N");
51 c$.max=Clazz.defineMethod(c$,"max",
52 function(d1,d2){
53 return Math.max(d1,d2);
54 },"~N,~N");
55 c$.min=Clazz.defineMethod(c$,"min",
56 function(d1,d2){
57 return Math.min(d1,d2);
58 },"~N,~N");
59 c$.pow=Clazz.defineMethod(c$,"pow",
60 function(d1,d2){
61 return Math.pow(d1,d2);
62 },"~N,~N");
63 c$.random=Clazz.defineMethod(c$,"random",
64 function(){
65 return Math.random();
66 });
67 c$.rint=Clazz.defineMethod(c$,"rint",
68 function(d){
69 return Math.round(d);
70 },"~N");
71 c$.round=Clazz.defineMethod(c$,"round",
72 function(d){
73 return Math.round(d);
74 },"~N");
75 c$.signum=Clazz.defineMethod(c$,"signum",
76 function(d){
77 if(Double.isNaN(d)){
78 return NaN;
79 }var sig=d;
80 if(d>0){
81 sig=1.0;
82 }else if(d<0){
83 sig=-1.0;
84 }return sig;
85 },"~N");
86 c$.signum=Clazz.defineMethod(c$,"signum",
87 function(f){
88 if(Float.isNaN(f)){
89 return NaN;
90 }var sig=f;
91 if(f>0){
92 sig=1.0;
93 }else if(f<0){
94 sig=-1.0;
95 }return sig;
96 },"~N");
97 c$.sinh=Clazz.defineMethod(c$,"sinh",
98 function(d){
99 return Math.sinh(d);
100 },"~N");
101 c$.sin=Clazz.defineMethod(c$,"sin",
102 function(d){
103 return Math.sin(d);
104 },"~N");
105 c$.sqrt=Clazz.defineMethod(c$,"sqrt",
106 function(d){
107 return Math.sqrt(d);
108 },"~N");
109 c$.tan=Clazz.defineMethod(c$,"tan",
110 function(d){
111 return Math.tan(d);
112 },"~N");
113 c$.tanh=Clazz.defineMethod(c$,"tanh",
114 function(d){
115 return Math.tanh(d);
116 },"~N");
117 c$.toDegrees=Clazz.defineMethod(c$,"toDegrees",
118 function(angrad){
119 return angrad*180/3.141592653589793;
120 },"~N");
121 c$.toRadians=Clazz.defineMethod(c$,"toRadians",
122 function(angdeg){
123 return angdeg/180*3.141592653589793;
124 },"~N");
125 Clazz.defineStatics(c$,
126 "E",2.718281828459045,
127 "PI",3.141592653589793,
128 "$random",null);
129 });