sorbetto.geometry.pencil_of_lines module

class sorbetto.geometry.pencil_of_lines.PencilOfLines(line_1: Line, line_2: Line, name: str | None = None)[source]

Bases: AbstractGeometricObject2D

This class is used to represent pencils of lines. \(\lambda_1 ( a_1 x + b_1 y + c_1 ) + \lambda_2 ( a_2 x + b_2 y + c_2 ) = 0\) See https://en.wikipedia.org/wiki/Pencil_(geometry)

draw(fig: Figure, ax: Axes, extent, **plt_kwargs)[source]

Draws the part of the pencil of lines that is within some axis-aligned box in some given Pyplot axes.

Parameters:
  • fig (_type_) – a Pyplot Figure object

  • ax (_type_) – a Pyplot Axes object

  • extent (_type_) – the axis-aligned box \((x_{min}, x_{max}, y_{min}, y_{max})\)

  • plt_kwargs – options for Pyplot’s plot command.

getLine(lambda_1: float, lambda_2: float) Line[source]

The line corresponding to \((\lambda_1, \lambda_2)\).

Parameters:
  • lambda_1 (float) – the value of \(\lambda_1\)

  • lambda_2 (float) – the value of \(\lambda_2\)

Returns:

the chosen line of the pixel

Return type:

Line

getVertex() Point[source]

Compute the pencil’s vertex.

Returns:

the vertex

Return type:

Point

property line_1: Line

The line corresponding to \((\lambda_1, \lambda_2)=(1, 0)\)

Returns:

\(a_1 x + b_1 y + c_1 = 0\)

Return type:

Line

property line_2: Line

The line corresponding to \((\lambda_1, \lambda_2)=(0, 1)\)

Returns:

\(a_2 x + b_2 y + c_2 = 0\)

Return type:

Line