Straight Line#

class gbox.StraightLine(length: float = 2.0, start_point: tuple[float, float] = (0.0, 0.0), angle: float = 0.0)#

Line segment, defined by its length, starting point and orientation with respect to the positive x-axs.

>>>line = StraightLine(5.0, (1.0, 1.0,), 0.25 * pi) >>>line.length … 5.0 >>>line.slope … 0.9999999999999999 >>>line.equation() … (0.9999999999999999, -1.0, 1.1102230246251565e-16) >>>line.locus.points …array([[1., 1.], … [1.03571246, 1.03571246], … [1.07142493, 1.07142493], … . … . … [4.49982144, 4.49982144], … [4.53553391, 4.53553391]])

equation()#

Returns a, b, c of the line equation in the form of ax + by + c = 0

property locus#

The locus of 2D shapes

Return type:

Points