On 10/1/2010 11:04 PM, Robert Hanson wrote:
>
> I lied. OK, see the JVXL file at
>
> http://stolaf.edu/people/hansonr/chemapps/jmol/docs/misc/cone.jvxl
>
> for a the surface z = sqrt(x^2 + y^2). Because it is a JVXL file, you 
> can go in and change the axes, change the scaling, change the origin, 
> etc., and have any cone you want. Even elliptical cones.

Thank you very much for creating this nice cone. Can I change its 
opening angle directly in the jvxl file?


>
> This was created at
>
> http://chemapps.stolaf.edu/jmol/docs/examples-11/isosurface.htm?USSIGNEDAPPLET&topic=14
>  
> <http://chemapps.stolaf.edu/jmol/docs/examples-11/isosurface.htm?USSIGNEDAPPLET&topic=14>
>
> by entering
>
> Math.sqrt(x^2 + y^2) into the input box, clicking the link discussed 
> there to "set the function" and then issuing the following on the 
> command line:
>
> javascript "x0=-5;y0=-5;dx=.2;dy=.2";isosurface functionXY 
> "curveAsStringXY" {-5 -5 -5} {-51 0.2 0 0} {51 0 0.2 0} {51 0 0 0.2};
>
> followed by
>
> write isosurface "cone.jvxl"

I tried that (under item 14, after zapping the preloaded model). I 
entered "Math.sqrt(x^2 + y^2)" into the box and clicked the "click here 
to set the function" link (confirmed by the message window). After 
entering the script (above) on the command line I am getting a very 
complicated "egg-box" shape.

If I do not click on the "click here to set the function" link I get a 
half of an ellipsoid (a "cone" with parabolic cross-sections) with the 
above script..

I am sure I am doing something wrong.

All below is above my head (I speak no programming language :-(). And 
that is my problem.

Thanks for your help,

PM


>
>
> That instructs Jmol to get the Z coordinate of the function from the 
> JavaScript function curveAsStringXY, which reads:
>
> function curveAsStringXY(app, nX, nY) {
>   var i1 = Math.abs(parseInt(""+nX));
>   var i2 = Math.abs(0.0 + parseInt(""+nY));
>   var s = ""
>   for (var i = 0; i < i1; i++)
>     for (var j = 0; j < i2; j++) {
>       s+= curveXY("",i, j) + "\n";
>     }
>   return s;
>
> }
>
>
> x0 = 0
> y0 = 0
> dx = 1
> dy = 1
> x = 0
> y = 0
>
> function curveXY(app, ix, iy) {
>  setXY(ix, iy)
>  return eval(myfunction);
> }
>
> function setXY(ix, iy) {
>  x = ix * dx + x0
>  y = iy * dy + y0
> }
>
>
> function setFunction(f,isSilent){
>   myfunction = 
> (arguments.length<1?document.getElementById("fOfXY").value:f)
>   var x=1
>   var y=1
>   var z=NaN
>   try{eval("z="+myfunction)}catch(e){alert(e)}
>   if(isNaN(z)){
>     alert("Your function is invalid")
>     myfunction = "(x*x+y*y)"
>   }
>   try{curveXY("",1,1)}catch(e){alert(e);return}
>   if (!isSilent)alert("The function Jmol will use is now z=" + 
> myfunction)
> }
>
> myfunction = "(x*x + y*y)/3"
> setFunction(myfunction,1)
>
>


------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security 
easier or more difficult to achieve? Read this whitepaper to separate the 
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to