organoid_tracker.imaging.lines module

Oper

class organoid_tracker.imaging.lines.Line3(point1: Vector3, point2: Vector3)

Bases: object

Defines a line in a three dimensional space.

direction: Vector3
static from_points(point1: Vector3, point2: Vector3)

Defines a line using two points.

point: Vector3
translate(translation: Vector3) Line3

Gets a translated copy of the line.

organoid_tracker.imaging.lines.direction_to_point(line: Line3, point: Vector3) float

Gets the 1D direction of a point towards a line. If the line is pointing upwards (read: parallel with the -axis), then this simply returns the same value as angles.direction_2d(vector, point_on_line). Returns a number from 0 to 360.

Note that is doesn’t matter in which direction the line is defined.

organoid_tracker.imaging.lines.distance_to_point(line: Line3, search_point: Vector3) float

Gets the distnace from the line to the given point. Note that we’re calculating the distance to an infinite line, which is different from calculating the distance to a line segment.

organoid_tracker.imaging.lines.point_on_line_2_nearest_to_line_1(*, line_1: Line3, line_2: Line3)

Finds the point on line 2 that is the nearest point towards line 1. See Wikipedia on skew lines for the formula.