Module imagingbook.common
Class EllipseSampler
java.lang.Object
imagingbook.common.geometry.fitting.ellipse.utils.EllipseSampler
Utility class for picking random points on a given ellipse.
- Version:
- 2022/11/17
-
Constructor Summary
ConstructorsConstructorDescriptionEllipseSampler
(GeometricEllipse ellipse) EllipseSampler
(GeometricEllipse ellipse, long seed) -
Method Summary
Modifier and TypeMethodDescriptionPnt2d[]
getPoints
(int n, double startAngle, double arcAngle, double sigma) Creates and returns an array of 2D points sampled on the ellipse associated with thisEllipseSampler
.
-
Constructor Details
-
EllipseSampler
-
EllipseSampler
-
-
Method Details
-
getPoints
Creates and returns an array of 2D points sampled on the ellipse associated with thisEllipseSampler
. Random Gaussian noise (with standard deviation sigma) is added to the individual x/y coordinates.- Parameters:
n
- number of pointsstartAngle
- initial angle (radians)arcAngle
- arc angle (radians)sigma
- amount of random noise- Returns:
- an array of sample points
-