|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.ObjectVector
class Vector
This class introduces vectors and enables basic operations with them. The coordinates are stored as a field of Fractions.
| Constructor Summary | |
|---|---|
Vector()
Constructs a null vector of dimension 0. |
|
Vector(Fraction[] V,
int d)
Constructs a vector from a field of Fractions. |
|
Vector(int d)
Constructs a zero vector of a given dimension. |
|
Vector(Point B)
Constructs a vector from a point (initial point will be the origin). |
|
Vector(Point A,
Point B)
Constructs a vector from two given points. |
|
| Method Summary | |
|---|---|
(package private) Vector |
add(Vector A)
Adds another vector to this vector. |
(package private) Cyclometric |
angleDirectionVectors(Vector W)
Calculates the angle of two direction vectors of lines (the resulting angle will be from 0 to π/2). |
(package private) Cyclometric |
angleDirectionVectors(Vector W,
char firstLabel,
char secondLabel,
boolean verbose)
Calculates the angle of two direction vectors of lines (the resulting angle will be from 0 to π/2). |
(package private) Cyclometric |
angleNormalVectorDirectionVector(Vector W)
Calculates the angle of a direction vector and a normal vector of lines (the resulting angle will be from 0 to π/2). |
(package private) Cyclometric |
angleNormalVectorDirectionVector(Vector W,
char firstLabel,
char secondLabel,
boolean verbose)
Calculates the angle of a direction vector and a normal vector of lines (the resulting angle will be from 0 to π/2). |
(package private) Cyclometric |
angleNormalVectors(Vector W)
Calculates the angle of two normal vectors of lines (the resulting angle will be from 0 to π/2). |
(package private) Cyclometric |
angleNormalVectors(Vector W,
char firstLabel,
char secondLabel,
boolean verbose)
Calculates the angle of two normal vectors of lines (the resulting angle will be from 0 to π/2). |
(package private) void |
copy(Vector I)
Copies another vector onto this vector. |
(package private) static Vector[] |
generateRandomParallelVectors(int DIM)
Generates two random parallel vectors of given dimension. |
(package private) static Vector[] |
generateRandomPerpendicularVectors(int DIM)
Generates two random perpendicular vectors of given dimension. |
(package private) static Vector[] |
generateRandomVectorsWithAngle30(int DIM)
Generates two random vectors of given dimension whose angle is π/6. |
(package private) static Vector[] |
generateRandomVectorsWithAngle45(int DIM)
Generates two random vectors of given dimension whose angle is π/4. |
(package private) static Vector[] |
generateRandomVectorsWithAngle60(int DIM)
Generates two random vectors of given dimension whose angle is π/3. |
(package private) static Vector[] |
generateRandomVectorsWithGivenAngle(PiFraction angle,
int DIM)
Generates two random vectors, while the angle of the vectors will be one of 0, π/6, π/4, π/3, or π/2. |
(package private) Fraction |
get(int i)
The getter of this class - returns the value of a given coordinate. |
(package private) int |
getDim()
Gets the dimensions of the vector. |
(package private) boolean |
isEqual(Vector C)
Checks if two vectors are equal. |
(package private) boolean |
isZeroVector()
Checks whether or not this vector is a zero vector. |
(package private) SquareRootFraction |
length()
Computes length of this vector. |
(package private) SquareRootFraction |
length(char label,
boolean verbose)
Computes length of this vector. |
(package private) Vector |
multiply(Fraction F)
Multiplies this vector by a scalar. |
(package private) Vector |
opposite()
Finds ppposite vector to this vector. |
(package private) Vector |
orthogonalComponent(Matrix W)
Finds the orthogonal component of the vector onto a given difference space. |
(package private) Vector |
orthogonalComponent(Matrix W,
boolean verbose)
Finds the orthogonal component of the vector onto a given difference space. |
(package private) Vector |
orthogonalProjection(Matrix W)
Finds the orthogonal projection of this vector onto a given difference space. |
(package private) Vector |
orthogonalProjection(Matrix W,
boolean verbose)
Finds the orthogonal projection of this vector onto a given difference space. |
(package private) Fraction |
scalarProduct(Vector F)
Computes scalar product of two vectors. |
(package private) SquareRootFraction |
scalarProductNorm(Vector F)
Computes scalar product of two vectors after normalizing them. |
(package private) void |
set(Fraction F,
int i)
The setter of this class - sets given coordinate to a given value. |
(package private) Vector |
subtract(Vector S)
Subtracts another vector from this vector. |
(package private) Matrix |
toMatrixColumn()
Converts the vector to a 1-column matrix. |
(package private) Matrix |
toMatrixRow()
Converts the vector to a 1-row matrix. |
(package private) String |
toTeX()
Prints this vector formatted as TeX code. |
(package private) String |
toText()
Prints this vector formatted as text. |
| Methods inherited from class |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
Vector()
Vector(Fraction[] V,
int d)
Fractions.
V - field of Fractions, containing the vector's coordinatesd - dimension of the vector, ie. number of its coordinatesVector(int d)
d - dimension of the vector, ie. number of its coordinatesVector(Point B)
B - terminal point
UnsupportedOperationException - Throws an exception if the points don't have equal dimension.
Vector(Point A,
Point B)
A - initial pointB - terminal point
UnsupportedOperationException - Throws an exception if the points don't have equal dimension.| Method Detail |
|---|
Vector add(Vector A)
A - addend vector
UnsupportedOperationException - Throws an exception if the vectors don't have equal dimension.Cyclometric angleDirectionVectors(Vector W)
V - the other vector
Cyclometric that holds all information about the angle; most importantly, if the angle was any of 0, π/6, π/4, π/3, π/2, this value is marked
together with double value in radians
Cyclometric angleDirectionVectors(Vector W,
char firstLabel,
char secondLabel,
boolean verbose)
V - the other vectorverbose - determines, if the method “talks” (creates any text and TeX output)
Cyclometric that holds all information about the angle; most importantly, if the angle was any of 0, π/6, π/4, π/3, π/2, this value is marked
together with double value in radiansCyclometric angleNormalVectorDirectionVector(Vector W)
V - the other vector
Cyclometric that holds all information about the angle; most importantly, if the angle was any of 0, π/6, π/4, π/3, π/2, this value is marked
together with double value in radians
Cyclometric angleNormalVectorDirectionVector(Vector W,
char firstLabel,
char secondLabel,
boolean verbose)
V - the other vectorverbose - determines, if the method “talks” (creates any text and TeX output)
Cyclometric that holds all information about the angle; most importantly, if the angle was any of 0, π/6, π/4, π/3, π/2, this value is marked
together with double value in radiansCyclometric angleNormalVectors(Vector W)
V - the other vector
Cyclometric that holds all information about the angle; most importantly, if the angle was any of 0, π/6, π/4, π/3, π/2, this value is marked
together with double value in radians
Cyclometric angleNormalVectors(Vector W,
char firstLabel,
char secondLabel,
boolean verbose)
V - the other vectorverbose - determines, if the method “talks” (creates any text and TeX output)
Cyclometric that holds all information about the angle; most importantly, if the angle was any of 0, π/6, π/4, π/3, π/2, this value is marked
together with double value in radiansvoid copy(Vector I)
=.
I - the image vectorstatic Vector[] generateRandomParallelVectors(int DIM)
DIM - dimension of the vectors
UnsupportedOperationException - if DIM is zerostatic Vector[] generateRandomPerpendicularVectors(int DIM)
UnsupportedOperationException - if DIM is zerostatic Vector[] generateRandomVectorsWithAngle30(int DIM)
UnsupportedOperationException - if DIM is less than threestatic Vector[] generateRandomVectorsWithAngle45(int DIM)
UnsupportedOperationException - if DIM is less than twostatic Vector[] generateRandomVectorsWithAngle60(int DIM)
UnsupportedOperationException - if DIM is less than three
static Vector[] generateRandomVectorsWithGivenAngle(PiFraction angle,
int DIM)
angle - the desired angle of vectors
UnsupportedOperationException - if angle is none of 0, π/6, π/4, π/3, or π/2Fraction get(int i)
i - the index of desired coordinate
Fraction)
IndexOutOfBoundsException - Throws an exception if the index isn't of <1,dimension of the vector>.int getDim()
boolean isEqual(Vector C)
C - comparand vector
UnsupportedOperationException - Throws an exception if the vectors don't have equal dimension.boolean isZeroVector()
SquareRootFraction length()
SquareRootFraction length(char label,
boolean verbose)
label - label of the matrixverbose - determines, if the method “talks” (creates any text and TeX output)
Vector multiply(Fraction F)
F - factor
F-multiple of this vectorVector opposite()
Vector orthogonalComponent(Matrix W)
W - difference space onto which we project the vector
Vector orthogonalComponent(Matrix W,
boolean verbose)
W - difference space onto which we project the vectorverbose - determines, if the method “talks” (creates any text and TeX output)
Vector orthogonalProjection(Matrix W)
W - difference space onto which we project the vector
Vector orthogonalProjection(Matrix W,
boolean verbose)
W - difference space onto which we project the vectorverbose - determines, if the method “talks” (creates any text and TeX output)
Fraction scalarProduct(Vector F)
F - factor vector
UnsupportedOperationException - Throws an exception if the vectors don't have equal dimension.SquareRootFraction scalarProductNorm(Vector F)
F - factor vector
UnsupportedOperationException - Throws an exception if the vectors don't have equal dimension.
void set(Fraction F,
int i)
F - the ith coordinate desired value (a Fraction)i - the index of desired coordinate
IndexOutOfBoundsException - Throws an exception if the index isn't of <1,dimension of the vector>.Vector subtract(Vector S)
S - subtrahend vector
UnsupportedOperationException - Throws an exception if the vectors don't have equal dimension.Matrix toMatrixColumn()
Matrix toMatrixRow()
String toTeX()
String toText()
( and end with )
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||