Vector

public class Vector

This is the Point class. This class handles storing information about vectors, which are basically Points but using polar coordinates as the default. The main reason this class exists is because some vector math needs to be done in the Follower, and dot products and cross products of Points just don't seem right. Also, there are a few more methods in here that make using Vectors a little easier than using a Point in polar coordinates.

Author

Anyi Lin - 10158 Scott's Bots

Aaron Yang - 10158 Scott's Bots

Harrison Womack - 10158 Scott's Bots

Constructors

Link copied to clipboard
public void Vector()
This creates a new Vector with zero magnitude and direction.
public void Vector(Point point)
public void Vector(double magnitude, double theta)
This creates a new Vector with a specified magnitude and direction.

Properties

Link copied to clipboard
public double magnitude
Link copied to clipboard
public double theta
Link copied to clipboard
public double xComponent
Link copied to clipboard
public double yComponent

Functions

Link copied to clipboard
public double getMagnitude()
Returns the magnitude of this Vector.
Link copied to clipboard
public double getTheta()
Returns the theta value, or angle, of this Vector.
Link copied to clipboard
public double getXComponent()
Returns the x component of this Vector.
Link copied to clipboard
public double getYComponent()
Returns the y component of this Vector.
Link copied to clipboard
public void rotateVector(double theta2)
This rotates the Vector by an angle, theta.
Link copied to clipboard
public void setComponents(double magnitude, double theta)
This sets the components of the Vector in regular vector coordinates.
Link copied to clipboard
public void setMagnitude(double magnitude)
This sets only the magnitude of the Vector.
Link copied to clipboard
public void setOrthogonalComponents(double xComponent, double yComponent)
This sets the orthogonal components of the Vector.
Link copied to clipboard
public void setTheta(double theta)
This sets only the angle, theta, of the Vector.