Helper Methods¶
-
evaluation.length()¶ Method for calculating the length of a given curve by the vertices
Parameters: data: numpy array
Numpy array of the vertices of shape (N,2)
Returns: length: int
Length of the distance vectors added up
-
evaluation.center_mass()¶ Method for calculating the center of mass (CM)
Parameters: data: numpy array
Numpy array of the vertices of shape (N,2)
Returns: cm: touple
Touple of coordinates of the CM
-
evaluation.bounding_box(scale=0.25)¶ Calculation of the diameter of the bounding box.
The bounding box is the box that fits the entire curve. It does not need to be a square, which is accounted for in both directions. The resulting diameter is scaled by a factor and returned.
Parameters: data: numpy array
Vertices from which the diameter is calculated. Shape is (n,2)
scale: double, optional
Factor by which the diameter is scaled. Default is 1/4.
Returns: double
Diameter of the bounding box.