org.jscience.mathematics.geometry
Class Vector2D

java.lang.Object
  extended by org.jscience.mathematics.geometry.GeometryElement
      extended by org.jscience.mathematics.geometry.AbstractVector
          extended by org.jscience.mathematics.geometry.Vector2D
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
HomogeneousVector2D, LiteralVector2D

public abstract class Vector2D
extends AbstractVector

�Q�����̃x�N�g����\����?ۃN���X?B

See Also:
Point2D, Serialized Form

Field Summary
static Vector2D minusI
          Opposite of the first canonical vector (coordinates : -1, 0, 0).
static Vector2D minusJ
          Opposite of the second canonical vector (coordinates : 0, -1, 0).
static Vector2D plusI
          First canonical vector (coordinates : 1, 0, 0).
static Vector2D plusJ
          Second canonical vector (coordinates : 0, 1, 0).
static Vector2D xUnitVector
          �Q�����̃O�??
static Vector2D yUnitVector
          �Q�����̃O�??
static Vector2D zeroVector
          �Q�����̃[�?
 
Constructor Summary
protected Vector2D()
          �I�u�W�F�N�g��?
protected Vector2D(boolean confirmedAsUnitized)
          �I�u�W�F�N�g��?
 
Method Summary
 Vector2D add(Vector2D mate)
          �x�N�g�����m�̘a��Ԃ�?
 double angleWith(Vector2D mate)
           
 int dimension()
          ������Ԃ�?
 Vector2D divide(double scale)
          �^����ꂽ�X�P?
 double dotProduct(Vector2D mate)
          ��?
protected abstract  Vector2D doTransformBy(boolean reverseTransform, CartesianTransformationOperator2D transformationOperator, java.util.Hashtable transformedGeometries)
          ���̃x�N�g����?
 Double2Vector getDouble2Vector()
           
 boolean identical(Vector2D mate)
          ��x�N�g���̓���?
 boolean identicalDirection(Vector2D mate)
          ��x�N�g���̓�����?
 boolean is2D()
          �Q�������ۂ���Ԃ�?
 Vector2D multiply(double scale)
          �^����ꂽ�X�P?
 double norm()
          �x�N�g���̃m������Ԃ�?
static LiteralVector2D of(double[] components)
          LiteralVector2D �̃C���X�^���X��?
static LiteralVector2D of(double x, double y)
          LiteralVector2D �̃C���X�^���X��?
 Vector2D orthogonal()
          Get a vector orthogonal to the instance.
 boolean parallelDirection(Vector2D mate)
          ��x�N�g���̓�����?
 Vector2D reverse()
          �e?
 Vector2D reverseTransformBy(CartesianTransformationOperator2D transformationOperator, java.util.Hashtable transformedGeometries)
          ���̃x�N�g����?
 Vector2D subtract(Vector2D mate)
          �x�N�g�����m��?
 double[] toDoubleArray()
          double�̔z��ɕϊ�����?
 Point2D toPoint2D()
          �Q�����̓_ (Point2D) �ɕϊ�����?
 Vector2D transformBy(boolean reverseTransform, CartesianTransformationOperator2D transformationOperator, java.util.Hashtable transformedGeometries)
          ���̃x�N�g����?
 Vector2D transformBy(CartesianTransformationOperator2D transformationOperator, java.util.Hashtable transformedGeometries)
          ���̃x�N�g����?
 Vector2D unitized()
          �P�ʉ������x�N�g����Ԃ�?
 Vector2D verticalVector()
          ��?
abstract  double x()
          �x�N�g���� X ?
static Vector2D xUnitVector()
          �Q�����̃O�??
abstract  double y()
          �x�N�g���� Y ?
static Vector2D yUnitVector()
          �Q�����̃O�??
static Vector2D zeroVector()
          �Q�����̃[�?
 double zOfCrossProduct(Vector2D mate)
          �O?
 
Methods inherited from class org.jscience.mathematics.geometry.AbstractVector
isVector, length, magnitude
 
Methods inherited from class org.jscience.mathematics.geometry.GeometryElement
getClassName, getToleranceForAngle, getToleranceForAngleAsObject, getToleranceForDistance, getToleranceForDistance2, getToleranceForDistanceAsObject, getToleranceForParameter, getToleranceForParameterAsObject, getToleranceForRealNumber, getToleranceForRealNumberAsObject, is1D, is3D, isCurve, isFreeform, isParametric, isPlacement, isPoint, isSurface, isTransformationOperator, makeIndent, output, output
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

plusI

public static final Vector2D plusI
First canonical vector (coordinates : 1, 0, 0). Same as xUnitVector. This is really an literalVector2D, hence it can't be changed in any way.


minusI

public static final Vector2D minusI
Opposite of the first canonical vector (coordinates : -1, 0, 0). This is really an literalVector2D, hence it can't be changed in any way.


plusJ

public static final Vector2D plusJ
Second canonical vector (coordinates : 0, 1, 0). Same as yUnitVector. This is really an literalVector2D, hence it can't be changed in any way.


minusJ

public static final Vector2D minusJ
Opposite of the second canonical vector (coordinates : 0, -1, 0). This is really an literalVector2D, hence it can't be changed in any way.


zeroVector

public static final Vector2D zeroVector
�Q�����̃[�?�x�N�g��?B


xUnitVector

public static final Vector2D xUnitVector
�Q�����̃O�??[�o���Ȓ���?W�n�� X �����̒P�ʃx�N�g��?B


yUnitVector

public static final Vector2D yUnitVector
�Q�����̃O�??[�o���Ȓ���?W�n�� Y �����̒P�ʃx�N�g��?B

Constructor Detail

Vector2D

protected Vector2D()
�I�u�W�F�N�g��?\�z����?B

?�?����悤�Ƃ���x�N�g���� �P�ʃx�N�g���ł��邩�ǂ���������Ȃ�?�?�?A�µ���� �P�ʃx�N�g���łȂ����Ƃ���?؂���Ă���?�?��ɂ�?A ���̃R���X�g���N�^��g�p����?B


Vector2D

protected Vector2D(boolean confirmedAsUnitized)
�I�u�W�F�N�g��?\�z����?B

?�?����悤�Ƃ���x�N�g���� �P�ʃx�N�g���ł��邩�ǂ���������?�?��ɂ�?A ���̃R���X�g���N�^��g�p����?B

Parameters:
confirmedAsUnitized - ?�?����悤�Ƃ���x�N�g���� �P�ʃx�N�g���ł���Ȃ�� true?A ����Ȃ��� false
Method Detail

zeroVector

public static Vector2D zeroVector()
�Q�����̃[�?�x�N�g����Ԃ�?B

Returns:
�Q�����̃[�?�x�N�g��

xUnitVector

public static Vector2D xUnitVector()
�Q�����̃O�??[�o���Ȓ���?W�n�� X �����̒P�ʃx�N�g����Ԃ�?B

Returns:
�Q�����̃O�??[�o���Ȓ���?W�n�� X �����̒P�ʃx�N�g��

yUnitVector

public static Vector2D yUnitVector()
�Q�����̃O�??[�o���Ȓ���?W�n�� Y �����̒P�ʃx�N�g����Ԃ�?B

Returns:
�Q�����̃O�??[�o���Ȓ���?W�n�� Y �����̒P�ʃx�N�g��

dimension

public int dimension()
������Ԃ�?B

?�� 2 ��Ԃ�?B

Specified by:
dimension in class GeometryElement
Returns:
�Q�����Ȃ̂�?A?�� 2

is2D

public boolean is2D()
�Q�������ۂ���Ԃ�?B

?�� true ��Ԃ�?B

Overrides:
is2D in class GeometryElement
Returns:
�Q�����Ȃ̂�?A?�� true

getDouble2Vector

public Double2Vector getDouble2Vector()

x

public abstract double x()
�x�N�g���� X ?�����Ԃ���?ۃ?�\�b�h?B

Returns:
�x�N�g���� X ?���

y

public abstract double y()
�x�N�g���� Y ?�����Ԃ���?ۃ?�\�b�h?B

Returns:
�x�N�g���� Y ?���

unitized

public Vector2D unitized()
�P�ʉ������x�N�g����Ԃ�?B

������?���Ȃ��x�N�g���ɑ΂��Ă��̃?�\�b�h��Ă�?�?�?A �����ł̓[�?�x�N�g����Ԃ��悤�ɂȂBĂ���?B ������?A�{���͗�O ZeroLengthException �𓊂���ׂ��ł���?B

Returns:
�P�ʉ������x�N�g��

reverse

public Vector2D reverse()
�e?����̕�?��𔽓]�������x�N�g����Ԃ�?B

Returns:
this �𔽓]�����x�N�g��

verticalVector

public Vector2D verticalVector()
��?g��?����ȃx�N�g����?���ɑI��ŕԂ�?B

Returns:
this ��?����ȃx�N�g��

dotProduct

public double dotProduct(Vector2D mate)
��?ς�Ԃ�?B

Parameters:
mate - ��?ς��鑊��̃x�N�g��
Returns:
��?�

zOfCrossProduct

public double zOfCrossProduct(Vector2D mate)
�O?ς� Z ?�����Ԃ�?B

Parameters:
mate - �O?ς��鑊��̃x�N�g��
Returns:
mate �Ƃ̊O?ς� Z ?���

add

public Vector2D add(Vector2D mate)
�x�N�g�����m�̘a��Ԃ�?B

Parameters:
mate - �a���鑊��̃x�N�g��
Returns:
�x�N�g���̘a (this + mate)

subtract

public Vector2D subtract(Vector2D mate)
�x�N�g�����m��?���Ԃ�?B

Parameters:
mate - ?����鑊��̃x�N�g��
Returns:
�x�N�g����?� (this - mate)

multiply

public Vector2D multiply(double scale)
�^����ꂽ�X�P?[����?悶���x�N�g����Ԃ�?B

Parameters:
scale - �X�P?[��
Returns:
(this * scale)

divide

public Vector2D divide(double scale)
�^����ꂽ�X�P?[���Ŋ��B��x�N�g����Ԃ�?B

Parameters:
scale - �X�P?[��
Returns:
(this / scale)

identical

public boolean identical(Vector2D mate)
��x�N�g���̓���?��𔻒肷��?B

��‚̃x�N�g����?��̑傫����?A ��?�?ݒ肳��Ă��鉉�Z?�?��?u�����̋��e��?�?v���?��������?A ��‚̃x�N�g���͓���ł����̂Ɣ��f����?B

Parameters:
mate - ����̑�?ۂƂȂ�x�N�g��
Returns:
��‚̃x�N�g��������̃x�N�g���ł���Ƃ݂Ȃ���� true?A����Ȃ��� false
See Also:
ConditionOfOperation, identicalDirection(Vector2D)

identicalDirection

public boolean identicalDirection(Vector2D mate)
��x�N�g���̓�����?��𔻒肷��?B

��‚̃x�N�g���̂Ȃ��p�x��?A ��?�?ݒ肳��Ă��鉉�Z?�?��?u�p�x�̋��e��?�?v���?��������?A ��‚̃x�N�g���͓�����ł����̂Ɣ��f����?B

�Ȃ�?A���]?�Ԃ͓���Ƃ݂Ȃ��Ȃ�?B

Parameters:
mate - ����̑�?ۂƂȂ�x�N�g��
Returns:
��‚̃x�N�g����������̃x�N�g���Ƃ݂Ȃ���� true?A����Ȃ��� false
See Also:
ConditionOfOperation, identical(Vector2D), parallelDirection(Vector2D)

parallelDirection

public boolean parallelDirection(Vector2D mate)
��x�N�g���̓�����?��𔻒肷��?B

��‚̃x�N�g���̂Ȃ��p�x��?A ��?�?ݒ肳��Ă��鉉�Z?�?��?u�p�x�̋��e��?�?v���?��������?A ��‚̃x�N�g���͓�����ł����̂Ɣ��f����?B

�Ȃ�?A���]?�Ԃӯ��Ƃ݂Ȃ�?B

Parameters:
mate - ����̑�?ۂƂȂ�x�N�g��
Returns:
��‚̃x�N�g����������̃x�N�g���Ƃ݂Ȃ���� true?A����Ȃ��� false
See Also:
ConditionOfOperation, identicalDirection(Vector2D)

norm

public double norm()
�x�N�g���̃m������Ԃ�?B

Specified by:
norm in class AbstractVector
Returns:
�x�N�g���̃m���� (x^2) + (y^2)

toPoint2D

public Point2D toPoint2D()
�Q�����̓_ (Point2D) �ɕϊ�����?B

Returns:
���_����̈ʒu�x�N�g���Ƃ݂Ȃ����_

toDoubleArray

public double[] toDoubleArray()
double�̔z��ɕϊ�����?B

Returns:
?����l����double�̔z��

orthogonal

public Vector2D orthogonal()
Get a vector orthogonal to the instance.

Returns:
a new normalized vector orthogonal to the instance
Throws:
java.lang.ArithmeticException - if the norm of the instance is null

angleWith

public double angleWith(Vector2D mate)

doTransformBy

protected abstract Vector2D doTransformBy(boolean reverseTransform,
                                          CartesianTransformationOperator2D transformationOperator,
                                          java.util.Hashtable transformedGeometries)
���̃x�N�g����?A�^����ꂽ�􉽓I�ϊ����Z�q�ŕϊ�����?B

transformedGeometries ��?A �ϊ��O�̊􉽗v�f��L?[�Ƃ�?A �ϊ���̊􉽗v�f��l�Ƃ���n�b�V���e?[�u���ł���?B

this �� transformedGeometries ��ɃL?[�Ƃ��đ�?݂��Ȃ�?�?��ɂ�?A this �� transformationOperator �ŕϊ�������̂�Ԃ�?B ����?ۂɃ?�\�b�h�Ք�ł� this ��L?[?A �ϊ����ʂ�l�Ƃ��� transformedGeometries �ɒljB���?B

this �� transformedGeometries ��Ɋ�ɃL?[�Ƃ��đ�?݂���?�?��ɂ�?A ��?ۂ̕ϊ���?s�Ȃ킸?A���̃L?[�ɑΉ�����l��Ԃ�?B ����?��?��?ċA�I��?s�Ȃ���?B

transformedGeometries �� null �ł�?\��Ȃ�?B transformedGeometries �� null ��?�?��ɂ�?A ?�� this �� transformationOperator �ŕϊ�������̂�Ԃ�?B

Parameters:
reverseTransform - �t�ϊ�����̂ł���� true?A�����łȂ���� false
transformationOperator - �􉽓I�ϊ����Z�q
transformedGeometries - ��ɓ��l�̕ϊ���{�����􉽗v�f��܂ރn�b�V���e?[�u��
Returns:
�ϊ���̊􉽗v�f

transformBy

public Vector2D transformBy(boolean reverseTransform,
                            CartesianTransformationOperator2D transformationOperator,
                            java.util.Hashtable transformedGeometries)
���̃x�N�g����?A�^����ꂽ�􉽓I�ϊ����Z�q�ŕϊ�����?B

transformedGeometries ��?A �ϊ��O�̊􉽗v�f��L?[�Ƃ�?A �ϊ���̊􉽗v�f��l�Ƃ���n�b�V���e?[�u���ł���?B

this �� transformedGeometries ��ɃL?[�Ƃ��đ�?݂��Ȃ�?�?��ɂ�?A this �� transformationOperator �ŕϊ�������̂�Ԃ�?B ����?ۂɃ?�\�b�h�Ք�ł� this ��L?[?A �ϊ����ʂ�l�Ƃ��� transformedGeometries �ɒljB���?B

this �� transformedGeometries ��Ɋ�ɃL?[�Ƃ��đ�?݂���?�?��ɂ�?A ��?ۂ̕ϊ���?s�Ȃ킸?A���̃L?[�ɑΉ�����l��Ԃ�?B ����?��?��?ċA�I��?s�Ȃ���?B

transformedGeometries �� null �ł�?\��Ȃ�?B transformedGeometries �� null ��?�?��ɂ�?A ?�� this �� transformationOperator �ŕϊ�������̂�Ԃ�?B

Parameters:
reverseTransform - �t�ϊ�����̂ł���� true?A�����łȂ���� false
transformationOperator - �􉽓I�ϊ����Z�q
transformedGeometries - ��ɓ��l�̕ϊ���{�����􉽗v�f��܂ރn�b�V���e?[�u��
Returns:
�ϊ���̊􉽗v�f

transformBy

public Vector2D transformBy(CartesianTransformationOperator2D transformationOperator,
                            java.util.Hashtable transformedGeometries)
���̃x�N�g����?A�^����ꂽ�􉽓I�ϊ����Z�q�ŕϊ�����?B

transformedGeometries ��?A �ϊ��O�̊􉽗v�f��L?[�Ƃ�?A �ϊ���̊􉽗v�f��l�Ƃ���n�b�V���e?[�u���ł���?B

this �� transformedGeometries ��ɃL?[�Ƃ��đ�?݂��Ȃ�?�?��ɂ�?A this �� transformationOperator �ŕϊ�������̂�Ԃ�?B ����?ۂɃ?�\�b�h�Ք�ł� this ��L?[?A �ϊ����ʂ�l�Ƃ��� transformedGeometries �ɒljB���?B

this �� transformedGeometries ��Ɋ�ɃL?[�Ƃ��đ�?݂���?�?��ɂ�?A ��?ۂ̕ϊ���?s�Ȃ킸?A���̃L?[�ɑΉ�����l��Ԃ�?B ����?��?��?ċA�I��?s�Ȃ���?B

transformedGeometries �� null �ł�?\��Ȃ�?B transformedGeometries �� null ��?�?��ɂ�?A ?�� this �� transformationOperator �ŕϊ�������̂�Ԃ�?B

Parameters:
transformationOperator - �􉽓I�ϊ����Z�q
transformedGeometries - ��ɓ��l�̕ϊ���{�����􉽗v�f��܂ރn�b�V���e?[�u��
Returns:
�ϊ���̊􉽗v�f

reverseTransformBy

public Vector2D reverseTransformBy(CartesianTransformationOperator2D transformationOperator,
                                   java.util.Hashtable transformedGeometries)
���̃x�N�g����?A�^����ꂽ�􉽓I�ϊ����Z�q�ŋt�ϊ�����?B

transformedGeometries ��?A �ϊ��O�̊􉽗v�f��L?[�Ƃ�?A �ϊ���̊􉽗v�f��l�Ƃ���n�b�V���e?[�u���ł���?B

this �� transformedGeometries ��ɃL?[�Ƃ��đ�?݂��Ȃ�?�?��ɂ�?A this �� transformationOperator �ŋt�ϊ�������̂�Ԃ�?B ����?ۂɃ?�\�b�h�Ք�ł� this ��L?[?A �ϊ����ʂ�l�Ƃ��� transformedGeometries �ɒljB���?B

this �� transformedGeometries ��Ɋ�ɃL?[�Ƃ��đ�?݂���?�?��ɂ�?A ��?ۂ̕ϊ���?s�Ȃ킸?A���̃L?[�ɑΉ�����l��Ԃ�?B ����?��?��?ċA�I��?s�Ȃ���?B

transformedGeometries �� null �ł�?\��Ȃ�?B transformedGeometries �� null ��?�?��ɂ�?A ?�� this �� transformationOperator �ŋt�ϊ�������̂�Ԃ�?B

Parameters:
transformationOperator - �􉽓I�ϊ����Z�q
transformedGeometries - ��ɓ��l�̕ϊ���{�����􉽗v�f��܂ރn�b�V���e?[�u��
Returns:
�t�ϊ���̊􉽗v�f

of

public static LiteralVector2D of(double x,
                                 double y)
LiteralVector2D �̃C���X�^���X��?�?�����?B

Parameters:
x - X ?���
y - Y ?���
Returns:
LiteralVector2D �̃C���X�^���X

of

public static LiteralVector2D of(double[] components)
LiteralVector2D �̃C���X�^���X��?�?�����?B

Parameters:
components - X, Y?����̔z�� (�v�f?� 2)
Returns:
LiteralVector2D �̃C���X�^���X