Class GridVector_2
java.lang.Object
Jcg.geometry.GridVector_2
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongA conversion from int to long is necessary to avoid overflowsReturn the vector difference (v-u), where u is the current vectorintReturn the dimension of the spaceReturn a new vector obtained by scalar divisionbooleangetCartesian(int i) return the i-th cartesian coordinate of the pointintgetX()intgetY()A conversion from int to long is necessary to avoid overflowsReturn a new vector obtained by multiplying by a scalaropposite()Return the opposite of the current vectorvoidsetCartesian(int i, Number value) set the i-th cartesian coordinatevoidsetX(int x) voidsetY(int y) Return the square length of a vectorReturn the vector sum (v+u), where u is the current vectortoString()Return a String representing vector coordinates
-
Field Details
-
x
public int x -
y
public int y
-
-
Constructor Details
-
GridVector_2
public GridVector_2() -
GridVector_2
public GridVector_2(int x, int y) -
GridVector_2
-
-
Method Details
-
getX
public int getX() -
getY
public int getY() -
setX
public void setX(int x) -
setY
public void setY(int y) -
equals
-
toString
-
dimension
-
getCartesian
Description copied from interface:Vector_return the i-th cartesian coordinate of the point- Specified by:
getCartesianin interfaceVector_
-
setCartesian
Description copied from interface:Vector_set the i-th cartesian coordinate- Specified by:
setCartesianin interfaceVector_
-
sum
Description copied from interface:Vector_Return the vector sum (v+u), where u is the current vector -
difference
Description copied from interface:Vector_Return the vector difference (v-u), where u is the current vector- Specified by:
differencein interfaceVector_
-
opposite
Description copied from interface:Vector_Return the opposite of the current vector -
innerProduct
A conversion from int to long is necessary to avoid overflows- Specified by:
innerProductin interfaceVector_- Parameters:
v-- Returns:
- this . v
-
crossProduct
A conversion from int to long is necessary to avoid overflows- Parameters:
v-- Returns:
- this ^ v
-
colinear
-
divisionByScalar
Description copied from interface:Vector_Return a new vector obtained by scalar division- Specified by:
divisionByScalarin interfaceVector_
-
multiplyByScalar
Description copied from interface:Vector_Return a new vector obtained by multiplying by a scalar- Specified by:
multiplyByScalarin interfaceVector_
-
squaredLength
Description copied from interface:Vector_Return the square length of a vector- Specified by:
squaredLengthin interfaceVector_
-