pythagoras.arrow module

class pythagoras.arrow.Arrow(start: tuple[float, float], end: tuple[float, float], size: float = 1, angle: float = 0.2617993877991494, zord: int = 0)[source]

Bases: PObject

A pointing arrow in space; it may possibly represent a vector.

Variables:
  • start (tuple[float, float]) – Point from which the arrow emanates.

  • end (tuple[float, float]) – Point at which the head is located.

  • size (float) – Size of the arrowhead.

  • width – Flare angle of the arrowhead.

angle: float
end: tuple[float, float]
extrema() list[tuple[float, float]][source]

Computes the furthermost points of the figure.

Returns:

A list with the bounding points of the object.

make_arrowhead() tuple[tuple[float, float], tuple[float, float]][source]

Computes the points which make up the arrowhead.

Returns:

The left- and rightmost points of the arrowhead.

size: float
start: tuple[float, float]
svg(ctx: RenderingContext, *args: POProperty) str[source]

Compiles the object into SVG commands.

Parameters:
  • ctx – Context associated with the Canvas instance.

  • args – Properties of the object.

Returns:

The corresponding SVG code.

tikz(ctx: RenderingContext, *args: POProperty) str[source]

Compiles the object into a sequence of TikZ instructions.

Parameters:
  • ctx – Context associated with the Canvas instance.

  • args – Properties of the object.

Returns:

The resulting TikZ code.