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.


Variable Index

 o x
 o y

Constructor Index

 o FVector(double, double)
Initializes the vector with the x and y coordinates
 o FVector(FPoint, FPoint)
Creates a vector that goes from a to b.

Method Index

 o add(FVector)
Return the addition of the vector with v.
 o dot(FVector)
Returns the dot product of the vector with v.
 o isTrigo(FVector)
Return true if v makes an angle with the vector in the trigonometric direction (a left turn).
 o length()
Returns the length of the vector.
 o mult(double)
Return the multiplication of the vector by a.
 o normal()
Returns the vector normal to this vector.

Variables

 o x
 double x
 o y
 double y

Constructors

 o FVector
 public FVector(double x,
                double y)
Initializes the vector with the x and y coordinates

 o FVector
 public FVector(FPoint a,
                FPoint b)
Creates a vector that goes from a to b.

Methods

 o dot
 public double dot(FVector v)
Returns the dot product of the vector with v.

 o normal
 public FVector normal()
Returns the vector normal to this vector.

 o isTrigo
 public boolean isTrigo(FVector v)
Return true if v makes an angle with the vector in the trigonometric direction (a left turn).

 o length
 public double length()
Returns the length of the vector.

 o add
 public FVector add(FVector v)
Return the addition of the vector with v.

 o mult
 public FVector mult(double a)
Return the multiplication of the vector by a.