栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

java sin.java

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

java sin.java

just do it!!!!!!     

回望来时的路,保持一颗年少的心,别忘记眼放光芒的年少的自己,加油!

package math;



public class Sin
{
	public static void test2()
	{
		System.out.println(Math.sin(Math.toRadians(42)));
		System.out.println(Math.sin(Math.toRadians(48)));
		
		System.out.println(Math.sin(45));
		
		System.out.println(Math.sin((45f / 180f) * Math.PI));
	}

	public static void main(String[] args)
	{
		test();
	}
	
	
	public static void test()
	{
		int a = 50;
		int b = 10;
		
		
		System.out.println(Math.tan(Math.toRadians(a)));
		double tan42 = Math.tan(Math.toRadians(a));
		
		System.out.println("============================");
		double pd = 1.0;
		System.out.println("pd : " + pd);
		
		double bd = pd / tan42;
		System.out.println("bd : " + bd);
		
		double x1 = bd;
		double y1 = pd;
		
		System.out.println("p : (" + x1 + ", " + y1 + ")");
		System.out.println("============================");
		
		double tan12 = Math.tan(Math.toRadians(b));
		double dc = pd / tan12;
		System.out.println("dc : " + dc);
		
		double bc = bd + dc;
		System.out.println("ab = bc = ca = " + bc);
//		double sin30 = Math.sin(Math.toRadians(30));
		double sin60 = Math.sin(Math.toRadians(60));
		double ae = bc * sin60;
		System.out.println("ae = " + ae);
		double x2 = bc / 2;
		double y2 = ae;
		System.out.println("a : (" + x2 + ", " + y2 + ")");
		System.out.println("============================");
		
		double tem01 = (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
		double ap = Math.sqrt(tem01);
		System.out.println("ap = " + ap);
		System.out.println("============================");
		
		double sin12 = Math.sin(Math.toRadians(b));
		double pc = pd / sin12;
		System.out.println("pc : " + pc);
		System.out.println("============================");
		double ca = bc;
		System.out.println("ca : " + ca);
		
		
		double cosPac = (ap * ap + ca * ca - pc * pc) / (2 * ap * ca);
		System.out.println("cosPac : " + cosPac);
		System.out.println(Math.cos(Math.toRadians(54)));
		System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>" + Math.toDegrees(Math.acos(cosPac)));
		System.out.println("====ZengWenfeng========================");
		
		System.out.println(Math.sin(Math.toRadians(0)));
		System.out.println(Math.sin(Math.toRadians(30)));
		System.out.println(Math.sin(Math.toRadians(45)));
		System.out.println(Math.sin(Math.toRadians(60)));
		System.out.println(Math.sin(Math.toRadians(90)));
		System.out.println("============================");
		System.out.println(Math.cos(Math.toRadians(30)));
		System.out.println(Math.cos(Math.toRadians(45)));
		System.out.println(Math.cos(Math.toRadians(60)));
		System.out.println(Math.cos(Math.toRadians(90)));
		
		System.out.println("============================");
		System.out.println(Math.toRadians(90));//弧度
		System.out.println(Math.PI / 2);//弧度
		System.out.println(Math.toRadians(54));
		
		System.out.println(Math.toDegrees(Math.PI));//弧度
		System.out.println(Math.toDegrees(Math.acos(0.5)));
	}

}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/880867.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号