Package georegression.geometry
Class UtilPoint3D_F64
java.lang.Object
georegression.geometry.UtilPoint3D_F64
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
axisLargestAbs
(GeoTuple3D_F64<?> p) Returns the axis with the largest absolute valuestatic void
boundingBox
(List<Point3D_F64> points, Box3D_F64 bounding) Finds the minimal volumeBox3D_F64
which contains all the points.static List<Point3D_F64>
copy
(List<Point3D_F64> pts) static double
distance
(double x0, double y0, double z0, double x1, double y1, double z1) Euclidean distance between the two specified pointsstatic double
distanceSq
(double x0, double y0, double z0, double x1, double y1, double z1) Euclidean distance squared between the two specified pointsstatic int
findClosestIdx
(double x, double y, double z, List<Point3D_F64> pts, double tol) Finds the closest point in the list to the specified point that is within tolerance.static Point3D_F64
mean
(List<Point3D_F64> points, int num, @Nullable Point3D_F64 mean) Computes the mean of the list of points up to element num.static Point3D_F64
mean
(List<Point3D_F64> points, @Nullable Point3D_F64 mean) Computes the mean of the list of points.static Point3D_F64
noiseNormal
(Point3D_F64 mean, double sigmaX, double sigmaY, double sigmaZ, Random rand, @Nullable Point3D_F64 output) static void
noiseNormal
(List<Point3D_F64> pts, double sigma, Random rand) static double
norm
(double x, double y, double z) static List<Point3D_F64>
static List<Point3D_F64>
random
(PlaneNormal3D_F64 plane, double max, int num, Random rand) Randomly generates a set of points on the plane centered at the plane's origin using a uniform distribution.static List<Point3D_F64>
random
(Point3D_F64 mean, double minX, double maxX, double minY, double maxY, double minZ, double maxZ, int num, Random rand) Creates a list of random points from a uniform distribution along each axisstatic List<Point3D_F64>
random
(Point3D_F64 mean, double min, double max, int num, Random rand) static List<Point3D_F64>
random
(Cylinder3D_F64 shape, int radialRadius, int count, Random rand) static List<Point3D_F64>
randomN
(Point3D_F64 mean, double stdX, double stdY, double stdZ, int num, Random rand) Creates a list of random points from a normal distribution along each axisstatic List<Point3D_F64>
randomN
(Point3D_F64 mean, double stdev, int num, Random rand) static List<PlaneNormal3D_F64>
randomNormals
(PlaneNormal3D_F64 plane, double max, int num, Random rand) static List<PlaneNormal3D_F64>
randomNormals
(Cylinder3D_F64 shape, int radialRadius, int count, Random rand) Points randomly along a cylinder with surface normals
-
Constructor Details
-
UtilPoint3D_F64
public UtilPoint3D_F64()
-
-
Method Details
-
findClosestIdx
Finds the closest point in the list to the specified point that is within tolerance. Returns the index of the point or -1 if none was found.- Parameters:
tol
- Tolerance in Euclidean distance.
-
distance
public static double distance(double x0, double y0, double z0, double x1, double y1, double z1) Euclidean distance between the two specified points- Parameters:
x0
- x-axis on Point 0y0
- y-axis on Point 0z0
- z-axis on Point 0x1
- x-axis on Point 1y1
- y-axis on Point 1z1
- z-axis on Point 1- Returns:
- Euclidean distance
-
distanceSq
public static double distanceSq(double x0, double y0, double z0, double x1, double y1, double z1) Euclidean distance squared between the two specified points- Parameters:
x0
- x-axis on Point 0y0
- y-axis on Point 0z0
- z-axis on Point 0x1
- x-axis on Point 1y1
- y-axis on Point 1z1
- z-axis on Point 1- Returns:
- Euclidean distance squared
-
norm
public static double norm(double x, double y, double z) -
copy
-
noiseNormal
public static Point3D_F64 noiseNormal(Point3D_F64 mean, double sigmaX, double sigmaY, double sigmaZ, Random rand, @Nullable @Nullable Point3D_F64 output) -
noiseNormal
-
random
Randomly generates a set of points on the plane centered at the plane's origin using a uniform distribution.- Parameters:
plane
- Planemax
- Maximum distance from centerrand
- random number generator- Returns:
- set of points on the plane
-
randomNormals
public static List<PlaneNormal3D_F64> randomNormals(PlaneNormal3D_F64 plane, double max, int num, Random rand) -
random
public static List<Point3D_F64> random(Cylinder3D_F64 shape, int radialRadius, int count, Random rand) -
randomNormals
public static List<PlaneNormal3D_F64> randomNormals(Cylinder3D_F64 shape, int radialRadius, int count, Random rand) Points randomly along a cylinder with surface normals -
random
-
random
public static List<Point3D_F64> random(Point3D_F64 mean, double minX, double maxX, double minY, double maxY, double minZ, double maxZ, int num, Random rand) Creates a list of random points from a uniform distribution along each axis -
random
public static List<Point3D_F64> random(Point3D_F64 mean, double min, double max, int num, Random rand) -
randomN
public static List<Point3D_F64> randomN(Point3D_F64 mean, double stdX, double stdY, double stdZ, int num, Random rand) Creates a list of random points from a normal distribution along each axis -
randomN
-
mean
Computes the mean of the list of points.- Parameters:
points
- List of pointsmean
- (Optional) storage for the mean. Can be null- Returns:
- Mean
-
mean
public static Point3D_F64 mean(List<Point3D_F64> points, int num, @Nullable @Nullable Point3D_F64 mean) Computes the mean of the list of points up to element num.- Parameters:
points
- List of pointsnum
- use points up to num, exclusive.mean
- (Optional) storage for the mean. Can be null- Returns:
- Mean
-
boundingBox
Finds the minimal volumeBox3D_F64
which contains all the points.- Parameters:
points
- Input: List of points.bounding
- Output: Bounding box
-
axisLargestAbs
Returns the axis with the largest absolute value
-