PointXYZ
A 2D coordinate with an X value, a Y value, and a value "Z" representing a heading angle. This class extends PointXY and adds an additional component (Z).
Much like the aforementioned PointXY class, PointXYZs are immutable objects, meaning that after they're created, the values stored inside of them cannot be changed. Many of the methods here will return new PointXYZ objects instead of modifying an existing one.
Fields
ZERO
A static PointXYZ with X: 0, Y: 0, and Z: 0 degrees.
COUNT
A static counter for how many instances of PointXYZ have been created.
Methods
PointXYZ()
Creates a new PointXYZ with 0 for all values.
PointXYZ(PointXY point, Angle z)
Creates a new PointXYZ instance from a PointXY and an Angle for the Z component.
PointXYZ(double x, double y, Angle z)
Creates a new PointXYZ instance with specified X, Y, and Angle for Z.
PointXYZ(double x, double y, double zDegrees)
Creates a new PointXYZ instance with specified X, Y, and Z in degrees.
PointXYZ(double x, double y)
Creates a new PointXYZ instance with specified X, Y, and a default Z of 0 degrees.
PointXYZ(PointXYZ point)
Creates a new PointXYZ instance by copying an existing PointXYZ.
parse(String string)
Parses a PointXYZ from a string. Examples: "45, 90, 0 deg", "10, 20, 30r". If only two values are provided, Z defaults to 0 degrees.
fromMetersToInches(double xMeters, double yMeters, Angle angle)
Creates a new PointXYZ and converts the provided X and Y values from meters to inches.
fromInchesToMeters(double xInches, double yInches, Angle angle)
Creates a new PointXYZ and converts the provided X and Y values from inches to meters.
fromMetersToCentimeters(double xMeters, double yMeters, Angle angle)
Creates a new PointXYZ and converts the provided X and Y values from meters to centimeters.
fromCentimetersToInches(double xCentimeters, double yCentimeters, Angle angle)
Creates a new PointXYZ and converts the provided X and Y values from centimeters to inches.
fromInchesToCentimeters(double xInches, double yInches, Angle angle)
Creates a new PointXYZ and converts the provided X and Y values from inches to centimeters.
add(PointXYZ a, PointXYZ b)
Static method. Adds two PointXYZ objects together (component-wise addition).
multiply(PointXYZ a, PointXYZ b)
Static method. Multiplies two PointXYZ objects together (component-wise multiplication).
multiply(PointXYZ a, double b)
Static method. Multiplies a PointXYZ by a double value (scales X, Y, and Z).
avg(PointXYZ a, PointXYZ b)
Static method. Gets the average of two PointXYZ objects.
zero()
Static method. Returns a new PointXYZ with all values set to 0.
isNear(PointXYZ a, PointXYZ b, double tolerance, Angle angleTolerance)
Static method. Checks if two PointXYZ objects are close to each other within specified distance and angle tolerances.
inDirection(PointXYZ base, double distance, Angle angle)
Static method. Creates a new PointXYZ a given distance away from a base point in a specified angle.
applyTranslation(PointXYZ base, Translation translation)
Static method. Applies a Translation to a base PointXYZ and returns the translated point.
rotate(PointXYZ point, PointXY center, Angle angle)
Static method. Rotates a PointXYZ around a center PointXY by a specified angle.
rotatePoints(Collection<PointXYZ> points, PointXY center, Angle angle)
Static method. Rotates a Collection of PointXYZ objects around a center PointXY by a specified angle.
rotatePoints(PointXYZ[] points, PointXY center, Angle angle)
Static method. Rotates an array of PointXYZ objects around a center PointXY by a specified angle.
zeroIfNull(PointXYZ point)
Static method. If the provided point is null, returns PointXYZ.ZERO. Otherwise, returns the provided point.
average(List<PointXYZ> points)
Static method. Calculates the average PointXYZ from a List of PointXYZ objects.
average(PointXYZ... points)
Static method. Calculates the average PointXYZ from a variable number of PointXYZ arguments.
reflectPointsOverX(double axis, List<PointXYZ> points)
Static method. Reflects a list of PointXYZ objects over a given X-axis.
reflectPointsOverX(double axis, PointXYZ... points)
Static method. Reflects an array of PointXYZ objects over a given X-axis.
reflectPointsOverY(double axis, List<PointXYZ> points)
Static method. Reflects a list of PointXYZ objects over a given Y-axis.
reflectPointsOverY(double axis, PointXYZ... points)
Static method. Reflects an array of PointXYZ objects over a given Y-axis.
reflectHeadings(List<PointXYZ> points)
Static method. Reflects the heading (Z component) of a list of PointXYZ objects.
reflectHeadings(PointXYZ... points)
Static method. Reflects the heading (Z component) of an array of PointXYZ objects.
z()
Returns the point's heading Angle (Z component).
add(PointXYZ a)
Adds another PointXYZ to this point.
addX(double x)
Returns a new PointXYZ with the X component incremented by x.
addY(double y)
Returns a new PointXYZ with the Y component incremented by y.
addZ(double zDegrees)
Returns a new PointXYZ with the Z (heading) component rotated by zDegrees.
addZ(Angle z)
Returns a new PointXYZ with the Z (heading) component rotated by z Angle.
multiply(PointXYZ a)
Multiplies this PointXYZ by another PointXYZ (component-wise).
multiply(double a)
Multiplies this PointXYZ by a double scalar.
avg(PointXYZ a)
Returns the average of this PointXYZ and another PointXYZ.
asPoint()
Casts this PointXYZ to a PointXY.
deepClone()
Creates a deep clone of this PointXYZ.
deepCloneAsPointXY()
Creates a deep clone of this PointXYZ as a PointXY.
rotate(PointXY center, Angle angle)
Rotates this PointXYZ around a center PointXY by an angle.
inDirection(double distance, Angle angle)
Returns a new PointXYZ a specified distance away from this point in a given angle.
applyTranslation(Translation translation)
Applies a Translation to this PointXYZ.
withX(double x)
Returns a new PointXYZ with the specified X component, keeping Y and Z the same.
withY(double y)
Returns a new PointXYZ with the specified Y component, keeping X and Z the same.
multiplyX(double multiplier)
Returns a new PointXYZ with its X component multiplied by multiplier.
multiplyY(double multiplier)
Returns a new PointXYZ with its Y component multiplied by multiplier.
multiplyZ(double multiplier)
Returns a new PointXYZ with its Z (heading) component multiplied by multiplier.
toString()
Returns a string representation of the PointXYZ.
equals(Object obj)
Compares this PointXYZ to another object for equality, considering both PointXYZ and PointXY types.
reflectOverX(double xAxis)
Returns a new PointXYZ reflected over the given X-axis.
reflectOverY(double yAxis)
Returns a new PointXYZ reflected over the given Y-axis.
isNear(PointXYZ a, double tolerance, Angle angleTolerance)
Checks if this PointXYZ is near another PointXYZ within specified tolerances.
reflectHeading()
Returns a new PointXYZ with its heading reflected (flipped by 180 degrees).
hashCode()
Returns a hash code for the PointXYZ.
clone()
Creates and returns a clone of this PointXYZ.