3角函数转化函数整理
先发一不分//有空再补全~~
class Math2 {
?var x_:Number;
?var y_:Number;
?var z_:Number;
?function MAth2 (a, b) {
??var point = {x:a, y:b};
?}
?//角度弧度转换
?function angle_radian (a, blo) {
??var new_val;
??blo ? new_val = a * 180 / Math.PI : new_val = a*Math.PI / 180;
??return new_val;
?}
?// 正弦(两角和差)
?function sin_2 (a, b, blo) {
??var new_val;
??blo ? new_val = Math.sin (a) * Math.cos (b) + Math.cos (a) * Math.sin (b) : new_val = Math.sin (a) * Math.cos (b) - Math.cos (a) * Math.sin (b);
??return new_val;
?}
?// 正弦2倍角
?function sin_ (a) {
??var new_val;
??new_val = a * Math.sin (a) * Math.cos (a);
??return new_val;
?}
?//正弦半角
?function sin_h (a) {
??var new_val:Object = new Object ();
??var tmp;
??tmp = Math.abs ((1 + Math.cos (a)) / 2);
??new_val = {minus:tmp, positive:-tmp};
??return new_val;
?}
?//正弦平方
?function sin_pow_ab (a, b) {
??var new_val;
??new_val = -.5 * (Math.cos (a + b) - Math.cos (a - b));
??return new_val;
?}
?// 余弦(两角和差)
?function cos_2 (a, b, blo) {
??var new_val;
??blo ? new_val = Math.cos (a) * Math.sin (b) - Math.sin (a) * Math.cos (b) : new_val = Math.cos (a) * Math.sin (b) + Math.sin (a) * Math.cos (b);
??return new_val;
?}
?//余弦2倍角
?function cos_ (a) {
??var new_val;
??new_val = Math.pow (Math.cos (a), 2) - Math.pow (Math.sin (a), 2);
??return new_val;
?}
?//余弦半角
?function cos_h (a) {
??var new_val:Object = new Object ();
??var tmp;
??tmp = Math.abs ((1 - Math.cos (a)) / 2);
??new_val = {minus:tmp, positive:-tmp};
??return new_val;
?}
?//余弦平方
?function cos_pow_ab (a, b) {
??var new_val;
??new_val = .5 * (Math.cos (a + b) + Math.cos (a - b));
??return new_val;
?}
?//正弦余弦成积
?function sina_cosb (a, b) {
??var new_val;
??new_val = .5 * (Math.sin (a + b) - Math.sin (a - b));
??return new_val;
?}
?///////////////////////////////////////////////////////////
?//正切两角和差
?function tan_2 (a, b, blo) {
??var new_val;
??blo ? new_val = (Math.tan (a) + Math.tan (b)) / 1 - Math.tan (a) * Math.tan (b) : new_val = (Math.tan (a) - Math.tan (b)) / 1 + Math.tan (a) * Math.tan (b);
?}
?//正切2倍角
?function tan_ (a) {
??var new_val;
??new_val = 2 * Math.tan (a) / (1 - Math.pow (Math.tan (a), 2));
??return new_val;
?}
?//正切半角
?function tan_h (a) {
??var new_val:Object = new Object ();
??var tmp;
??tmp = Math.abs ((1 - Math.cos (a)) / (1 + Math.cos (a))) * Math.tan (a / 2);
??new_val = {minus:tmp, positive:-tmp};
??return new_val;
?}
}