Segment#
- class Segment(A, B)#
Bases:
Line
A finite line segment from A to B.
- __init__(A, B)#
Methods
__init__
(A, B)length
()Length of the segment (|B - A|).
parameter_from_point
(point)For the line T = A + t(B-A), return t such that T = point (if on the line).
sample
(n)Split the segment into n evenly spaced complex points (inclusive).
set_orientation
(start_point, end_point)Set orientation so that A is closer to start_point and B closer to end_point.
shorten
(length, side[, inplace])Shorten by length on side 'A' or 'B'.
- set_orientation(start_point, end_point)#
Set orientation so that A is closer to start_point and B closer to end_point.
- shorten(length, side, inplace=False)#
Shorten by length on side ‘A’ or ‘B’.
- sample(n)#
Split the segment into n evenly spaced complex points (inclusive).
- parameter_from_point(point)#
For the line T = A + t(B-A), return t such that T = point (if on the line).