package com.drawbridge.jsengine.jsobjects;
public class Math extends JSObject{
public Math(){
// Add constant properties
super.addProperty("PI", new JSNumber(java.lang.Math.PI));
super.addProperty("E", new JSNumber(java.lang.Math.E));
super.addProperty("SQRT2", new JSNumber(java.lang.Math.sqrt(2)));
super.addProperty("SQRT1_2", new JSNumber(java.lang.Math.sqrt(0.5)));
super.addProperty("LN2", new JSNumber(java.lang.Math.log(2)));
super.addProperty("LN10", new JSNumber(java.lang.Math.log10(1)));
super.addProperty("LOG2E", new JSNumber(java.lang.Math.log((((JSNumber)super.getProperty("E")).mValue))));
super.addProperty("LOG10E", new JSNumber(java.lang.Math.log10(((JSNumber)super.getProperty("E")).mValue)));
// Add function properties
super.addProperty("abs", new JSNativeFunction(this, "abs", new Class<?>[] {JSNumber.class}));
super.addProperty("acos", new JSNativeFunction(this, "acos", new Class<?>[] {JSNumber.class}));
super.addProperty("asin", new JSNativeFunction(this, "asin", new Class<?>[] {JSNumber.class}));
super.addProperty("atan", new JSNativeFunction(this, "atan", new Class<?>[] {JSNumber.class}));
super.addProperty("atan2", new JSNativeFunction(this, "atan2", new Class<?>[] {JSNumber.class}));
super.addProperty("ceil", new JSNativeFunction(this, "ceil", new Class<?>[] {JSNumber.class}));
super.addProperty("cos", new JSNativeFunction(this, "cos", new Class<?>[] {JSNumber.class}));
super.addProperty("exp", new JSNativeFunction(this, "exp", new Class<?>[] {JSNumber.class}));
super.addProperty("floor", new JSNativeFunction(this, "floor", new Class<?>[] {JSNumber.class}));
super.addProperty("log", new JSNativeFunction(this, "log", new Class<?>[] {JSNumber.class}));
super.addProperty("max", new JSNativeFunction(this, "max", new Class<?>[] {JSNumber.class}));
super.addProperty("min", new JSNativeFunction(this, "min", new Class<?>[] {JSNumber.class}));
super.addProperty("pow", new JSNativeFunction(this, "pow", new Class<?>[] {JSNumber.class}));
super.addProperty("random", new JSNativeFunction(this, "random", new Class<?>[] {JSNumber.class}));
super.addProperty("round", new JSNativeFunction(this, "round", new Class<?>[] {JSNumber.class}));
super.addProperty("sin", new JSNativeFunction(this, "sin", new Class<?>[] {JSNumber.class}));
super.addProperty("sqrt", new JSNativeFunction(this, "sqrt", new Class<?>[] {JSNumber.class}));
super.addProperty("tan", new JSNativeFunction(this, "tan", new Class<?>[] {JSNumber.class}));
}
public String toString(){
return "[Math]";
}
}