:orphan:
# PetscDrawTriangle
draws a triangle  onto a drawable. 
## Synopsis
```
#include "petscdraw.h" 
PetscErrorCode PetscDrawTriangle(PetscDraw draw, PetscReal x1, PetscReal y_1, PetscReal x2, PetscReal y2, PetscReal x3, PetscReal y3, int c1, int c2, int c3)
```
Not Collective


## Input Parameters

- ***draw -*** the drawing context
- ***x1 -*** coordinate of the first vertex
- ***y1 -*** coordinate of the first vertex
- ***x2 -*** coordinate of the second vertex
- ***y2 -*** coordinate of the second vertex
- ***x3 -*** coordinate of the third vertex
- ***y3 -*** coordinate of the third vertex
- ***c1 -*** color of the first vertex
- ***c2 -*** color of the second vertex
- ***c3 -*** color of the third vertext





## See Also
 `PetscDraw`, `PetscDrawLine()`, `PetscDrawRectangle()`, `PetscDrawEllipse()`, `PetscDrawMarker()`, `PetscDrawPoint()`, `PetscDrawArrow()`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/draw/interface/dtri.c.html#PetscDrawTriangle">src/sys/classes/draw/interface/dtri.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/draw/impls/image/drawimage.c.html#PetscDrawTriangle_Image">PetscDrawTriangle_Image in src/sys/classes/draw/impls/image/drawimage.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/draw/impls/null/drawnull.c.html#PetscDrawTriangle_Null">PetscDrawTriangle_Null in src/sys/classes/draw/impls/null/drawnull.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/draw/impls/tikz/tikz.c.html#PetscDrawTriangle_TikZ">PetscDrawTriangle_TikZ in src/sys/classes/draw/impls/tikz/tikz.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/draw/impls/win32/win32draw.c.html#PetscDrawTriangle_Win32">PetscDrawTriangle_Win32 in src/sys/classes/draw/impls/win32/win32draw.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/draw/impls/x/xops.c.html#PetscDrawTriangle_X">PetscDrawTriangle_X in src/sys/classes/draw/impls/x/xops.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/draw/interface/dtri.c)


[Index of all Draw routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
