fork(1) download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.math.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. double A= -0.5,B=-0.4,C=7, X0=0.3, Y0=0.2;
  13. double X0Y0= Math.pow(X0-A, 2) + Math.pow(Y0-B, 2) + C*Math.exp(-(Math.pow(X0+A, 2))-Math.pow(Y0+B, 2));
  14. double X1Y0= Math.pow(X0+0.1-A, 2) + Math.pow(Y0-B, 2) + C*Math.exp(-(Math.pow(X0+0.1+A, 2))-Math.pow(Y0+B, 2));
  15. double X0Y1= Math.pow(X0-A, 2) + Math.pow(Y0+0.1-B, 2) + C*Math.exp(-(Math.pow(X0+A, 2))-Math.pow(Y0+0.1+B, 2));
  16.  
  17. double gx=(X1Y0-X0Y0)/0.1;
  18. double gy=(X0Y1-X0Y0)/0.1;
  19.  
  20. double rez=Math.atan2(gy, gx);
  21. System.out.println(rez);
  22.  
  23. }
  24. }
Success #stdin #stdout 0.1s 320320KB
stdin
Standard input is empty
stdout
0.7277904421087558