Package georegression.geometry
Class UtilPoint3D_F32
java.lang.Object
georegression.geometry.UtilPoint3D_F32
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
axisLargestAbs
(GeoTuple3D_F32<?> p) Returns the axis with the largest absolute valuestatic void
boundingBox
(List<Point3D_F32> points, Box3D_F32 bounding) Finds the minimal volumeBox3D_F32
which contains all the points.static List<Point3D_F32>
copy
(List<Point3D_F32> pts) static float
distance
(float x0, float y0, float z0, float x1, float y1, float z1) Euclidean distance between the two specified pointsstatic float
distanceSq
(float x0, float y0, float z0, float x1, float y1, float z1) Euclidean distance squared between the two specified pointsstatic int
findClosestIdx
(float x, float y, float z, List<Point3D_F32> pts, float tol) Finds the closest point in the list to the specified point that is within tolerance.static Point3D_F32
mean
(List<Point3D_F32> points, int num, @Nullable Point3D_F32 mean) Computes the mean of the list of points up to element num.static Point3D_F32
mean
(List<Point3D_F32> points, @Nullable Point3D_F32 mean) Computes the mean of the list of points.static Point3D_F32
noiseNormal
(Point3D_F32 mean, float sigmaX, float sigmaY, float sigmaZ, Random rand, @Nullable Point3D_F32 output) static void
noiseNormal
(List<Point3D_F32> pts, float sigma, Random rand) static float
norm
(float x, float y, float z) static List<Point3D_F32>
static List<Point3D_F32>
random
(PlaneNormal3D_F32 plane, float 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_F32>
random
(Point3D_F32 mean, float minX, float maxX, float minY, float maxY, float minZ, float maxZ, int num, Random rand) Creates a list of random points from a uniform distribution along each axisstatic List<Point3D_F32>
random
(Point3D_F32 mean, float min, float max, int num, Random rand) static List<Point3D_F32>
random
(Cylinder3D_F32 shape, int radialRadius, int count, Random rand) static List<Point3D_F32>
randomN
(Point3D_F32 mean, float stdX, float stdY, float stdZ, int num, Random rand) Creates a list of random points from a normal distribution along each axisstatic List<Point3D_F32>
randomN
(Point3D_F32 mean, float stdev, int num, Random rand) static List<PlaneNormal3D_F32>
randomNormals
(PlaneNormal3D_F32 plane, float max, int num, Random rand) static List<PlaneNormal3D_F32>
randomNormals
(Cylinder3D_F32 shape, int radialRadius, int count, Random rand) Points randomly along a cylinder with surface normals
-
Constructor Details
-
UtilPoint3D_F32
public UtilPoint3D_F32()
-
-
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 float distance(float x0, float y0, float z0, float x1, float y1, float 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 float distanceSq(float x0, float y0, float z0, float x1, float y1, float 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 float norm(float x, float y, float z) -
copy
-
noiseNormal
public static Point3D_F32 noiseNormal(Point3D_F32 mean, float sigmaX, float sigmaY, float sigmaZ, Random rand, @Nullable @Nullable Point3D_F32 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_F32> randomNormals(PlaneNormal3D_F32 plane, float max, int num, Random rand) -
random
public static List<Point3D_F32> random(Cylinder3D_F32 shape, int radialRadius, int count, Random rand) -
randomNormals
public static List<PlaneNormal3D_F32> randomNormals(Cylinder3D_F32 shape, int radialRadius, int count, Random rand) Points randomly along a cylinder with surface normals -
random
-
random
public static List<Point3D_F32> random(Point3D_F32 mean, float minX, float maxX, float minY, float maxY, float minZ, float maxZ, int num, Random rand) Creates a list of random points from a uniform distribution along each axis -
random
public static List<Point3D_F32> random(Point3D_F32 mean, float min, float max, int num, Random rand) -
randomN
public static List<Point3D_F32> randomN(Point3D_F32 mean, float stdX, float stdY, float 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_F32 mean(List<Point3D_F32> points, int num, @Nullable @Nullable Point3D_F32 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_F32
which contains all the points.- Parameters:
points
- Input: List of points.bounding
- Output: Bounding box
-
axisLargestAbs
Returns the axis with the largest absolute value
-