com.jblend.graphics.util
クラス Calc <Phase3>

java.lang.Object
  |
  +--com.jblend.graphics.util.Calc

public final class Calc
extends java.lang.Object

固定小数演算のためのユーティリティのクラスです。


メソッドの概要
static int cos(int a)
          余弦(コサイン)の近似値を計算します。
static int sin(int a)
          正弦(サイン)の近似値を計算します。
static int sqrt(int x)
          平方根の近似値を計算します。
 
クラス java.lang.Object から継承したメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

メソッドの詳細

sqrt

public static final int sqrt(int x)
平方根の近似値を計算します。

このクラスのほかのメソッドと異なり、このメソッドの引数や戻り値は、 固定小数点ではなく、通常の整数です。

パラメータ:
x - 値
戻り値:
平方根の近似値
例外:
java.lang.IllegalArgumentException - 負の値が指定された時に発生する

sin

public static final int sin(int a)
正弦(サイン)の近似値を計算します。

引数 a に角度を4096 分円単位(2πラジアン=4096)で指定してください。 任意の符号付き整数を指定できます。

パラメータ:
a - 角度(4096 分円単位)
戻り値:
正弦値の 4096 倍の値

cos

public static final int cos(int a)
余弦(コサイン)の近似値を計算します。

引数 a に角度を4096 分円単位(2πラジアン=4096)で指定してください。 任意の符号付き整数を指定できます。

パラメータ:
a - 角度(4096 分円単位)
戻り値:
余弦値の 4096 倍の値


Copyright 2003 Aplix Corporation. All rights reserved. Aplix Confidential and Restricted.