from java.awt import*
from jhplot import *
from jhplot.math.exp4j import *
from jhplot.math.exp4j.function import *
class cf2(Function):
def apply(self,val):
a=val[0]*val[0]*val[0]
if (val[0]<0): return 0
if (val[0]>0): return a
return 0
e=ExpressionBuilder("cf2(x)")
func=cf2("cf2",1);
e.function(func)
e.variables("x")
fff=e.build()
fff.setVariable("x", 10);
print fff.evaluate()
Ads help maintain this website.