Show 2D functions using JavaView in 3D
Code: "javaview_2d_functions.py". Programming language: Python
DMelt Version 2.5. Last modified: 06/26/1974. License: Pro
https://datamelt.org/code/cache/javaview_2d_functions_3913.py
To run this script using the DMelt IDE,
copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.
# Show how to visualise a 2D function using Python code
# @author Sergei Chekanov
from jhplot import F2D,HJavaView
from java.awt import Color
f1 = F2D("3*(x*x+y*y)", -1.0, 1.0, -1.0, 1.0)
c1= HJavaView()
obj1=c1.add(f1)
obj1.setTransparency(0.2);
obj1.showTransparency(True);
f2 = F2D("(x+y)", -1.0, 1.0, -1.0, 1.0)
obj2=c1.add(f2)
# draw 2 functions
c1.draw([obj1,obj2])
view=c1.getView()
disp=view.getDisplay()
disp.showAxes(True)
c1.visible()
You see the box below because you did not login.