日期:2014-05-20 浏览次数:21081 次
package com.test.coreJava.util.num;
public class sineHyperbolic {
/**
* 形如 sinh x=(e^x-e^-x)/2 的函数称为
* 双曲线正弦函数(sine hyperbolic)
*/
public boolean matchSinh(double x,double y){
boolean result=false;
if(y==this.getSinh(x))result=true;
return result;
}
public double getSinh(double x){
double e=Math.E;//
double y=e,result;
for(int i=1;i<x;i++)
y*=e;
result=(y-1/y)/2;
return result;
}
public static void main(String[] args) {
sineHyperbolic sinh=new sineHyperbolic();
System.out.println(sinh.matchSinh(2, 3.6268604078470186));
System.out.println(sinh.matchSinh(2, 3.6));
}
}