Py5Graphics.triangle()

A triangle is a plane created by connecting three points.

Description

A triangle is a plane created by connecting three points. The first two arguments specify the first point, the middle two arguments specify the second point, and the last two arguments specify the third point.

This method is the same as triangle() but linked to a Py5Graphics object. To see example code for how it can be used, see triangle().

Underlying Java method: PGraphics.triangle

Syntax

triangle(x1: float, y1: float, x2: float, y2: float, x3: float, y3: float, /) -> None

Parameters

  • x1: float - x-coordinate of the first point

  • x2: float - x-coordinate of the second point

  • x3: float - x-coordinate of the third point

  • y1: float - y-coordinate of the first point

  • y2: float - y-coordinate of the second point

  • y3: float - y-coordinate of the third point

Updated on September 11, 2021 16:51:34pm UTC