Processing provides method triangle()
to draw a triangle. This code draws a white triangle on black background.
void setup() {
size(500, 500);
background(0);
fill(255);
noStroke();
}
void draw() {
triangle(250, 225, 225, 275, 275, 275);
}