public class Location
extends java.lang.Object
Constructor and Description |
---|
Location(LengthUnit units) |
Location(LengthUnit units,
double x,
double y,
double z,
double rotation) |
Modifier and Type | Method and Description |
---|---|
Location |
add(Location l)
Returns a new Location with the given Location's X, Y, and Z components added to this
Location's X, Y, and Z components.
|
Location |
addWithRotation(Location l)
Returns a new Location with the given Location's X, Y, and Z components added to this
Location's X, Y, and Z components.
|
boolean |
containsLocation(Location originLocation,
Location targetLocation)
Checks if targetLocation is contained in current location given the current location represents a rectangular item with the origin in originLocation.
|
Location |
convertToUnits(LengthUnit units) |
Location |
derive(java.lang.Double x,
java.lang.Double y,
java.lang.Double z,
java.lang.Double rotation)
Returns a new Location with the same units as this one but with values updated to the passed
in values.
|
Location |
derive(Location location,
boolean x,
boolean y,
boolean z,
boolean rotation)
Returns a new Location with the same units as this one but with values updated from
a second Location.
|
Location |
deriveLengths(Length x,
Length y,
Length z,
java.lang.Double rotation)
Returns a new Location with the same units as this one but with values updated to the passed
in Lengths.
|
Length |
dotProduct(Location l)
Return the dot product of this and l.
|
boolean |
equals(java.lang.Object obj)
Performs a unit agnostic equality check.
|
Length |
getLengthX() |
Length |
getLengthY() |
Length |
getLengthZ() |
double |
getLinearDistanceTo(double x,
double y) |
double |
getLinearDistanceTo(Location location)
Returns the distance between this Location and the specified Location in the units of this
Location.
|
double |
getLinearDistanceToLine(Location A,
Location B)
Returns the distance between this Location and the infinite line defined by the Locations a and b,
in the units of this Location.
|
double |
getLinearDistanceToLineSegment(Location A,
Location B)
Returns the distance between this Location and the line segment defined by the Locations a and b,
in the units of this Location.
|
Length |
getLinearLengthTo(Location location) |
double |
getRotation() |
LengthUnit |
getUnits() |
double |
getX() |
Point |
getXyPoint() |
double |
getXyzcDistanceTo(Location location) |
double |
getXyzDistanceTo(Location location) |
Length |
getXyzLengthTo(Location location) |
double |
getY() |
double |
getZ() |
int |
hashCode() |
Location |
invert(boolean x,
boolean y,
boolean z,
boolean rotation)
Returns a new Location with the same units as this one and with any of fields specified as
true inverted from the values of this one.
|
boolean |
isInitialized() |
Location |
multiply(double factor)
Returns a new Location based on this Location with values multiplied by the specified factor.
|
Location |
multiply(double x,
double y,
double z,
double rotation)
Returns a new Location based on this Location with values multiplied by the specified values.
|
Location |
multiply(Location l)
Returns a new Location with the given Location's X, Y and Z components multiplied by this
Location's X, Y and Z components.
|
Location |
offsetWithRotationFrom(Location baseLocation) |
Location |
rotateXy(double angle)
Returns a new Location with this Location's X and Y rotated by angle.
|
Location |
rotateXyCenterPoint(Location center,
double angle) |
Location |
subtract(Location l)
Returns a new Location with the given Location's X, Y, and Z components subtracted from this
Location's X, Y, and Z components.
|
Location |
subtractWithRotation(Location l)
Same as
subtract(Location) but also subtracts rotation. |
java.lang.String |
toString() |
Location |
unitVectorTo(Location l)
Returns the unit vector of the vector between this and location l in units of this.
|
public static final Location origin
public Location(LengthUnit units)
public Location(LengthUnit units, double x, double y, double z, double rotation)
public double getX()
public double getY()
public double getZ()
public double getRotation()
public LengthUnit getUnits()
public Location convertToUnits(LengthUnit units)
public double getLinearDistanceTo(Location location)
location
- public double getLinearDistanceTo(double x, double y)
public double getXyzDistanceTo(Location location)
public double getXyzcDistanceTo(Location location)
public double getLinearDistanceToLine(Location A, Location B)
public double getLinearDistanceToLineSegment(Location A, Location B)
public Length getLengthX()
public Length getLengthY()
public Length getLengthZ()
public Location subtract(Location l)
l
- public Location subtractWithRotation(Location l)
subtract(Location)
but also subtracts rotation.l
- public Location add(Location l)
l
- public Location addWithRotation(Location l)
l
- public Location multiply(Location l)
l
- public Location multiply(double x, double y, double z, double rotation)
x
- y
- z
- rotation
- public Location multiply(double factor)
factor
- public Location invert(boolean x, boolean y, boolean z, boolean rotation)
x
- y
- z
- rotation
- public Location unitVectorTo(Location l)
l
- public Length dotProduct(Location l)
l
- public Location derive(java.lang.Double x, java.lang.Double y, java.lang.Double z, java.lang.Double rotation)
x
- y
- z
- rotation
- public Location deriveLengths(Length x, Length y, Length z, java.lang.Double rotation)
x
- y
- z
- rotation
- public Location derive(Location location, boolean x, boolean y, boolean z, boolean rotation)
location
- x
- y
- z
- rotation
- public Location rotateXy(double angle)
angle
- public java.lang.String toString()
toString
in class java.lang.Object
public Point getXyPoint()
public boolean containsLocation(Location originLocation, Location targetLocation)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean isInitialized()