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

📄 ballistics.java

📁 本书透彻讲解了经典的《设计模式:可复用面向对象软件的基础》一书涵盖的23种基本设计模式。本书将这些设计模式分成五类:接口型模式、责任型模式、构造型模式、操作型模式
💻 JAVA
字号:
package com.oozinoz.ballistics;

/*
 * Copyright (c) 2000 Steven J. Metsker. All Rights Reserved.
 * 
 * Steve Metsker makes no representations or warranties about
 * the fitness of this software for any particular purpose, 
 * including the implied warranty of merchantability.
 */

/**
 * This utility class provides standard equations for
 * burn rate and thrust.
 * 
 * @author Steven J. Metsker
 *
 * @version 1.0
 */
public class Ballistics 
{



	private static BallisticsFunction rate;
	private static BallisticsFunction thrust;

/**
 * Return a standard function that models the burn rate
 * of a rocket's fuel as function of burn time and the
 * peak time when the burn area reaches its maximum.
 *
 * @return a standard function that models the burn rate
 *         of a rocket's fuel as function of burn time and 
 *         the peak time when the burn area reaches its 
 *         maximum
 */
public static BallisticsFunction rate() 
{
	if (rate == null) 
	{
		rate = new BallisticsFunction() 
		{
			public double function(double t, double tPeak) 
			{
				return .5 * Math.pow(25, -Math.pow((t - tPeak), 2));
			}
		};
	}
	return rate;
}

/**
 * Return a standard function that models the thrust
 * of a rocket engine as a function of burn time and the
 * peak time when the burn area reaches its maximum.
 *
 * @return a standard function that models the thrust
 *         of a rocket engine as a function of burn time 
 *         and the peak time when the burn area reaches 
 *         its maximum
 */
public static BallisticsFunction thrust() 
{
	if (thrust == null) {
		thrust = new BallisticsFunction() 
		{
			public double function(double t, double tPeak) 
			{
				return 1.7
					* Math.pow((rate().function(t, tPeak) / .6), (1 / .3));
			}
		};
	}
	return thrust;
}
}

⌨️ 快捷键说明

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