public class Point2D extends Object
コンストラクタと説明 |
---|
Point2D(double x, double y)
Point2D の新しいインスタンスを作成します。 |
修飾子と型 | メソッドと説明 |
---|---|
Point2D |
add(double x, double y)
この点の座標に指定された座標が加算された点を返します。
|
Point2D |
add(Point2D point)
この点の座標に指定された点の座標が加算された点を返します。
|
double |
angle(double x, double y)
この点で表されるベクトルと指定されたベクトルの間の角度(度)を計算します。
|
double |
angle(Point2D point)
この点で表されるベクトルと指定された点で表されるベクトルの間の角度(度)を計算します。
|
double |
angle(Point2D p1, Point2D p2)
この点を頂点とした3つの点の間の角度(度)を計算します。
|
Point3D |
crossProduct(double x, double y)
このインスタンスで表されるベクトルと指定されたベクトルのクロス積を計算します。
|
Point3D |
crossProduct(Point2D vector)
このインスタンスで表されるベクトルと指定されたベクトルのクロス積を計算します。
|
double |
distance(double x1, double y1)
この点と点
(x1, y1) の間の距離を計算します。 |
double |
distance(Point2D point)
この点と指定された
point の間の距離を計算します。 |
double |
dotProduct(double x, double y)
このインスタンスで表されるベクトルと指定されたベクトルのドット(スカラー)積を計算します。
|
double |
dotProduct(Point2D vector)
このインスタンスで表されるベクトルと指定されたベクトルのドット(スカラー)積を計算します。
|
boolean |
equals(Object obj)
このオブジェクトと他のオブジェクトが等しいかどうかを示します。
|
double |
getX()
x座標。
|
double |
getY()
y座標。
|
int |
hashCode()
点のハッシュ・コード値を返します。
|
double |
magnitude()
このインスタンスで表される相対的な大きさベクトルの大きさ(長さ)を計算します。
|
Point2D |
midpoint(double x, double y)
この点と指定された座標の中間にある点を返します。
|
Point2D |
midpoint(Point2D point)
この点と指定された点の中間にある点を返します。
|
Point2D |
multiply(double factor)
この点の座標に指定された係数を乗算した点を返します。
|
Point2D |
normalize()
このインスタンスで表される相対的な大きさベクトルを正規化します。
|
Point2D |
subtract(double x, double y)
この点の座標から指定された座標が減算された点を返します。
|
Point2D |
subtract(Point2D point)
この点の座標から指定された点の座標が減算された点を返します。
|
String |
toString()
この
Point2D の文字列表現を返します。 |
public static final Point2D ZERO
public Point2D(double x, double y)
Point2D
の新しいインスタンスを作成します。x
- 点のx座標y
- 点のy座標public final double getX()
public final double getY()
public double distance(double x1, double y1)
(x1, y1)
の間の距離を計算します。x1
- 他の点のx座標y1
- 他の点のy座標(x1, y1)
の間の距離。public double distance(Point2D point)
point
の間の距離を計算します。point
- 他方の点point
の間の距離。NullPointerException
- 指定されたpoint
がnullの場合public Point2D add(double x, double y)
x
- X座標の加算y
- Y座標の加算public Point2D add(Point2D point)
point
- 加算される座標を持つ点NullPointerException
- 指定されたpoint
がnullの場合public Point2D subtract(double x, double y)
x
- X座標の減算y
- Y座標の減算public Point2D multiply(double factor)
factor
- 座標を乗算する係数public Point2D subtract(Point2D point)
point
- 減算される座標を持つ点NullPointerException
- 指定されたpoint
がnullの場合public Point2D normalize()
Point2D
インスタンスで表される正規化されたベクトルpublic Point2D midpoint(double x, double y)
x
- 2番目のエンドポイントのX座標y
- 2番目のエンドポイントのY座標public Point2D midpoint(Point2D point)
point
- 他方のエンドポイントNullPointerException
- 指定されたpoint
がnullの場合public double angle(double x, double y)
x
- 他方のベクトルのXの大きさy
- 他方のベクトルのYの大きさpublic double angle(Point2D point)
point
- 他方のベクトルNaN
NullPointerException
- 指定されたpoint
がnullの場合public double angle(Point2D p1, Point2D p2)
p1
- 1つの点p2
- 他の点NaN
NullPointerException
- p1
またはp2
がnullの場合public double magnitude()
public double dotProduct(double x, double y)
x
- 他方のベクトルのXの大きさy
- 他方のベクトルのYの大きさpublic double dotProduct(Point2D vector)
vector
- 他方のベクトルNullPointerException
- 指定されたvector
がnullの場合public Point3D crossProduct(double x, double y)
x
- 他方のベクトルのXの大きさy
- 他方のベクトルのYの大きさpublic Point3D crossProduct(Point2D vector)
vector
- 他方のベクトルNullPointerException
- 指定されたvector
がnullの場合public boolean equals(Object obj)
Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.