Point

public class Point

This is the Point class. This class handles storing information about the location of points in 2D space in both Cartesian, or rectangular, and polar coordinates. Additionally, this contains the method to find the distance between two Points.

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 Point(double rOrX, double thetaOrY, int identifier)
This creates a new Point with coordinate inputs and a specified coordinate system.
public void Point(Pose pose)
This creates a new Point from a Pose.
public void Point(double setX, double setY)
This creates a new Point from a X and Y value.

Properties

Link copied to clipboard
public final static int CARTESIAN
Link copied to clipboard
public final static int POLAR
Link copied to clipboard
public double r
Link copied to clipboard
public double theta
Link copied to clipboard
public double x
Link copied to clipboard
public double y

Functions

Link copied to clipboard
public static Array<double> cartesianToPolar(double x, double y)
This takes in an x and y value and converts them to polar coordinates.
Link copied to clipboard
public Point copy()
This creates a new Point with the same information as this Point, just pointing to a different memory location.
Link copied to clipboard
public double distanceFrom(Point otherPoint)
Calculates the distance between this Point and some other specified Point.
Link copied to clipboard
public double getR()
Returns the r value of this Point.
Link copied to clipboard
public double getTheta()
Returns the theta value of this Point.
Link copied to clipboard
public double getX()
Returns the x value of this Point.
Link copied to clipboard
public double getY()
Returns the y value of this Point.
Link copied to clipboard
public static Array<double> polarToCartesian(double r, double theta)
This takes in an r and theta value and converts them to Cartesian coordinates.
Link copied to clipboard
public void setCoordinates(double rOrX, double thetaOrY, int identifier)
This sets the coordinates of the Point using the specified coordinate system.
Link copied to clipboard
public String toString()