⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 trig_functions_degrees.as

📁 这是《Flash MX编程与创意实现》的源代码
💻 AS
字号:
/*
  Trigonometric Functions in Degrees
  Oct. 29, 2002
  (c) 2002 Robert Penner
  
  These are wrappers for the built-in Math functions
  (sin, cos, tan, and their inverses) that allow you
  to work with angles in degrees instead of radians.
  
  Discussed in Chapter 3 of 
  Robert Penner's Programming Macromedia Flash MX
  
  http://www.robertpenner.com/profmx
  http://www.amazon.com/exec/obidos/ASIN/0072223561/robertpennerc-20
*/

	
Math.sinD = function (angle) {
	return Math.sin (angle * (Math.PI / 180));
};

Math.cosD = function (angle) {
	return Math.cos (angle * (Math.PI / 180));
};

Math.tanD = function (angle) {
	return Math.tan (angle * (Math.PI / 180));
};

Math.asinD = function (ratio) {
	return Math.asin (ratio) * (180 / Math.PI);
};

Math.acosD = function (ratio) {
	return Math.acos (ratio) * (180 / Math.PI);
};

Math.atanD = function (ratio) {
	return Math.atan (ratio) * (180 / Math.PI);
};

Math.atan2D = function (y, x) {
	return Math.atan2 (y, x) * (180 / Math.PI);
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -