public class Vector
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Vector(Location l1,
Location l2)
Member Functions
|
Modifier and Type | Method and Description |
---|---|
double |
angle()
Returns the angle in radians of the vector from the equator.
|
Vector |
beginning(double beginningLength)
Returns the first part of the vector that is the length specified.
|
double |
distance(Location l)
Determines the distance between a location and this vector.
|
Vector |
end(double beginningLength)
Returns the last part of the vector, starting after the beginningLength
|
Location |
getL1()
Returns the first Location of the Vector
|
Location |
getL2()
Returns the second Location of the Vector
|
double |
heading()
Returns number of degrees clockwise from due North.
|
double |
length()
Returns the length of the Vector in meters.
|
Location |
locAlongVector(double length)
Returns the location that is the length specified
along the vector.
|
static void |
main(java.lang.String[] args) |
double |
matchDistanceAlongVector(Location l)
Returns length along vector where this location is closest
to the vector.
|
Vector |
middle(double length1,
double length2)
Returns the middle of this vector that starts at length1 and
ends at length2.
|
java.lang.String |
toString() |
public Location getL1()
public Location getL2()
public double length()
public double distance(Location l)
l
- The locationpublic double matchDistanceAlongVector(Location l)
l
- public double angle()
public double heading()
public Location locAlongVector(double length)
length
- public Vector beginning(double beginningLength)
beginningLength
- The length of the beginning part of the vector
to be returnedpublic Vector end(double beginningLength)
beginningLength
- The length after which the resulting vector
is to be returned.public Vector middle(double length1, double length2)
length1
- length2
- public static void main(java.lang.String[] args)
public java.lang.String toString()
toString
in class java.lang.Object