OSDN Git Service
(root)
/
nyartoolkit-and
/
nyartoolkit-and.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
git-svn-id: http://svn.sourceforge.jp/svnroot/nyartoolkit/NyARToolkit/trunk@803 7cac0...
[nyartoolkit-and/nyartoolkit-and.git]
/
lib
/
src
/
jp
/
nyatla
/
nyartoolkit
/
core
/
types
/
NyARIntPoint2d.java
diff --git
a/lib/src/jp/nyatla/nyartoolkit/core/types/NyARIntPoint2d.java
b/lib/src/jp/nyatla/nyartoolkit/core/types/NyARIntPoint2d.java
index
0edd449
..
ebc422b
100644
(file)
--- a/
lib/src/jp/nyatla/nyartoolkit/core/types/NyARIntPoint2d.java
+++ b/
lib/src/jp/nyatla/nyartoolkit/core/types/NyARIntPoint2d.java
@@
-31,18
+31,21
@@
package jp.nyatla.nyartoolkit.core.types;
\r
\r
/**
\r
package jp.nyatla.nyartoolkit.core.types;
\r
\r
/**
\r
- * int型の二次元の点を格納します。
\r
+ *
このクラスは、
int型の二次元の点を格納します。
\r
*
\r
*/
\r
public class NyARIntPoint2d
\r
{
\r
*
\r
*/
\r
public class NyARIntPoint2d
\r
{
\r
+ /** X座標の値です。*/
\r
public int x;
\r
public int x;
\r
-
\r
+ /** Y座標の値です。*/
\r
public int y;
\r
/**
\r
public int y;
\r
/**
\r
- *
配列ファクトリ
\r
+ *
この関数は、指定サイズのオブジェクト配列を作ります。
\r
* @param i_number
\r
* @param i_number
\r
+ * 作成する配列の長さ
\r
* @return
\r
* @return
\r
+ * 新しい配列。
\r
*/
\r
public static NyARIntPoint2d[] createArray(int i_number)
\r
{
\r
*/
\r
public static NyARIntPoint2d[] createArray(int i_number)
\r
{
\r
@@
-54,9
+57,12
@@
public class NyARIntPoint2d
return ret;
\r
}
\r
/**
\r
return ret;
\r
}
\r
/**
\r
- * i_fromからi_toへ配列をコピーします。
\r
+ * この関数は、配列の値をコピーします。
\r
+ * 配列の長さは、同じである必要があります。
\r
* @param i_from
\r
* @param i_from
\r
+ * コピー元の配列
\r
* @param i_to
\r
* @param i_to
\r
+ * コピー先の配列
\r
*/
\r
public static void copyArray(final NyARIntPoint2d[] i_from,NyARIntPoint2d[] i_to)
\r
{
\r
*/
\r
public static void copyArray(final NyARIntPoint2d[] i_from,NyARIntPoint2d[] i_to)
\r
{
\r
@@
-68,10
+74,11
@@
public class NyARIntPoint2d
return;
\r
}
\r
/**
\r
return;
\r
}
\r
/**
\r
- *
p2-p1間の距離の二乗値を計算
します。
\r
+ *
この関数は、インスタンスの座標と、指定点との距離の2乗値を返
します。
\r
* @param i_p1
\r
* @param i_p1
\r
- *
@param i_p2
\r
+ *
点の座標
\r
* @return
\r
* @return
\r
+ * i_p1との距離の二乗値
\r
*/
\r
public final int sqDist(NyARIntPoint2d i_p1)
\r
{
\r
*/
\r
public final int sqDist(NyARIntPoint2d i_p1)
\r
{
\r
@@
-79,12
+86,13
@@
public class NyARIntPoint2d
int y=this.y-i_p1.y;
\r
return x*x+y*y;
\r
}
\r
int y=this.y-i_p1.y;
\r
return x*x+y*y;
\r
}
\r
-
\r
/**
\r
/**
\r
- * 中心位置を計算して設定する。
\r
- * @param i_point
\r
- * @param i_number_of_vertex
\r
- */
\r
+ * この関数は、頂点集合から、中央値(Σp[n]/n)を求めて、インスタンスにセットします。
\r
+ * @param i_points
\r
+ * 頂点集合を格納した配列です。
\r
+ * @param i_number_of_data
\r
+ * 配列中の有効な頂点数です。
\r
+ */
\r
public final void setCenterPos(NyARIntPoint2d[] i_point,int i_number_of_vertex)
\r
{
\r
int cx,cy;
\r
public final void setCenterPos(NyARIntPoint2d[] i_point,int i_number_of_vertex)
\r
{
\r
int cx,cy;
\r
@@
-97,19
+105,32
@@
public class NyARIntPoint2d
this.y=cy/i_number_of_vertex;
\r
}
\r
/**
\r
this.y=cy/i_number_of_vertex;
\r
}
\r
/**
\r
- *
i_sourceの値を、thisへ
セットします。
\r
+ *
この関数は、オブジェクトからインスタンスに値を
セットします。
\r
* @param i_source
\r
* @param i_source
\r
+ * コピー元のオブジェクト。
\r
*/
\r
public final void setValue(NyARIntPoint2d i_source)
\r
{
\r
this.x=i_source.x;
\r
this.y=i_source.y;
\r
}
\r
*/
\r
public final void setValue(NyARIntPoint2d i_source)
\r
{
\r
this.x=i_source.x;
\r
this.y=i_source.y;
\r
}
\r
+ /**
\r
+ * この関数は、オブジェクトからインスタンスに値をセットします。
\r
+ * @param i_source
\r
+ * コピー元のオブジェクト。
\r
+ */
\r
public final void setValue(NyARDoublePoint2d i_source)
\r
{
\r
this.x=(int)i_source.x;
\r
this.y=(int)i_source.y;
\r
}
\r
public final void setValue(NyARDoublePoint2d i_source)
\r
{
\r
this.x=(int)i_source.x;
\r
this.y=(int)i_source.y;
\r
}
\r
+ /**
\r
+ * この関数は、インスタンスに値をセットします。
\r
+ * @param i_x
\r
+ * {@link #x}にセットする値
\r
+ * @param i_y
\r
+ * {@link #y}にセットする値
\r
+ */
\r
public final void setValue(int i_x,int i_y)
\r
{
\r
this.x=i_x;
\r
public final void setValue(int i_x,int i_y)
\r
{
\r
this.x=i_x;
\r