skspatial.objects.Triangle.line

Triangle.line(side: str) skspatial.objects.line.Line[source]

Return the line along a side of the triangle.

Parameters
side: str

‘a’, ‘b’, or ‘c’. Side ‘a’ is the side across from vertex ‘A’.

Returns
Line

Line along the side.

Raises
ValueError

If the side is not ‘a’, ‘b’, or ‘c’.

Examples

>>> from skspatial.objects import Triangle
>>> triangle = Triangle([0, 0], [1, 0], [0, 1])
>>> triangle.line('a')
Line(point=Point([1, 0]), direction=Vector([-1,  1]))
>>> triangle.line('b')
Line(point=Point([0, 1]), direction=Vector([ 0, -1]))
>>> triangle.line('c')
Line(point=Point([0, 0]), direction=Vector([1, 0]))
>>> triangle.line('d')
Traceback (most recent call last):
...
ValueError: The side must be 'a', 'b', or 'c'.