Class FVector
java.lang.Object
|
+----FVector
- class FVector
- extends Object
The FVector class provides a basic 2-dimensional vector type,
along with some uselful methods.
-
x
-
-
y
-
-
FVector(double, double)
- Initializes the vector with the x and y coordinates
-
FVector(FPoint, FPoint)
- Creates a vector that goes from a to b.
-
add(FVector)
- Return the addition of the vector with v.
-
dot(FVector)
- Returns the dot product of the vector with v.
-
isTrigo(FVector)
- Return true if v makes an angle with the vector in the
trigonometric direction (a left turn).
-
length()
- Returns the length of the vector.
-
mult(double)
- Return the multiplication of the vector by a.
-
normal()
- Returns the vector normal to this vector.
x
double x
y
double y
FVector
public FVector(double x,
double y)
- Initializes the vector with the x and y coordinates
FVector
public FVector(FPoint a,
FPoint b)
- Creates a vector that goes from a to b.
dot
public double dot(FVector v)
- Returns the dot product of the vector with v.
normal
public FVector normal()
- Returns the vector normal to this vector.
isTrigo
public boolean isTrigo(FVector v)
- Return true if v makes an angle with the vector in the
trigonometric direction (a left turn).
length
public double length()
- Returns the length of the vector.
add
public FVector add(FVector v)
- Return the addition of the vector with v.
mult
public FVector mult(double a)
- Return the multiplication of the vector by a.