class TrailTriangle extends TrailShape { TrailTriangle(float x, float y, float dx, float dy, float size, float dSizePercent, color sColor) { super(x, y, dx, dy, size, dSizePercent, sColor); } /** * Draws an equilateral triangle with sides of the * given size, centered at (x,y). */ void drawShape(float x, float y, float size) { float a = size * cos(radians(30)); triangle(x, y - a / 2.0, x - size / 2.0, y + a / 2.0, x + size / 2.0, y + a / 2.0); } }