public final class Point3d extends Tuple3d
We consider a point to be a tuple representing a single physical point in space.
Constructor and Description |
---|
Point3d() |
Point3d(double x,
double y,
double z)
Create with values for each dimension.
|
Point3d(Point3f point)
Creates with the same values as an existing
Point3d . |
Point3d(Tuple3d point)
Creates with the same values as an existing
Tuple3d . |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEqual(Object other) |
double |
distance(Point3d point)
The Euclidean distance between this point and another
Point3d . |
double |
distanceSquared(Point3d point)
The square of the Euclidean distance between this point and another
Point3d . |
double |
distanceSquared(Point3i point)
The square of the Euclidean distance between this point and another
Point3i . |
Point3d |
dropZ()
Creates a new point with identical x and y values, but with z set to 0.
|
boolean |
equals(Object o) |
boolean |
equalsTolerance(Point3d other,
double delta)
Checks if this point is equal to another
Point3d accepting a tolerance between double
values. |
int |
hashCode() |
static Point3d |
immutableAdd(Point3d point,
int x,
int y,
int z)
Adds values to a point immutably.
|
static Point3d |
immutableAdd(Tuple3d tuple1,
Tuple3d tuple2)
Adds two tuples immutably.
|
static Point3d |
immutableScale(Tuple3d tuple,
int factor)
Scales a tuple immutably.
|
static Point3d |
immutableSubtract(Tuple3d tuple,
Tuple3d toSubtract)
|
static Point3d |
immutableSubtract(Tuple3i tuple,
Tuple3d toSubtract)
|
Point3d |
max(double val)
Element-wise maximum between this point and a scalar.
|
Point3d |
max(Tuple3d point)
Element-wise maximum between this point and another.
|
Point3d |
min(ReadableTuple3i point)
Element-wise minimum between this point and another.
|
Point3d |
min(Tuple3d point)
Element-wise minimum between this point and another.
|
double[] |
toArray()
Converts the point to an array.
|
double[] |
toArrayXY()
Converts the X and Y dimensions of the point to an array.
|
absolute, add, add, add, divideBy, divideBy, dotProduct, increment, incrementX, incrementY, incrementZ, length, normalize, scale, scaleXY, setValueByDimension, setX, setX, setY, setY, setZ, setZ, subtract, toString, valueByDimension, valueByDimension, x, y, z
public Point3d(Point3f point)
Point3d
.point
- to copy values from.public Point3d(Tuple3d point)
Tuple3d
.point
- to copy values from.public Point3d(double x, double y, double z)
x
- the value for the X-dimension.y
- the value for the Y-dimension.z
- the value for the Z-dimension.public Point3d()
public double distance(Point3d point)
Point3d
.point
- the other point to a measure a distance to.public double distanceSquared(Point3d point)
Point3d
.point
- the other point to a measure a distance to.public double distanceSquared(Point3i point)
Point3i
.point
- the other point to a measure a distance to.public Point3d dropZ()
This is an immutable operation that does not affect current state.
public Point3d min(Tuple3d point)
point
- the other point.public Point3d min(ReadableTuple3i point)
point
- the other point.public Point3d max(double val)
val
- the scalar.public boolean equalsTolerance(Point3d other, double delta)
Point3d
accepting a tolerance between double
values.other
- the other point to check for equality with.delta
- the maximum difference before two double values are considered to be unequal.public double[] toArray()
public double[] toArrayXY()
public Point3d max(Tuple3d point)
point
- the other point.public static Point3d immutableAdd(Tuple3d tuple1, Tuple3d tuple2)
tuple1
- the first tuple to add.tuple2
- the second tuple to add.public static Point3d immutableAdd(Point3d point, int x, int y, int z)
point
- the point to add.x
- the value to add to the X-component.y
- the value to add to the Y-component.z
- the value to add to the Z-component.public static Point3d immutableSubtract(Tuple3d tuple, Tuple3d toSubtract)
tuple
- the tuple to subtract from.toSubtract
- the tuple to subtract.public static Point3d immutableSubtract(Tuple3i tuple, Tuple3d toSubtract)
tuple
- the tuple to subtract from.toSubtract
- the tuple to subtract.public static Point3d immutableScale(Tuple3d tuple, int factor)
tuple
- the tuple to scale.factor
- what to multiply each dimension by.factor
.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.