Hi there,

I am stuck on a return function. I have a triangle, each corner is defined by pair of float [] arrays: float[] xArray = new float[3]; float[] yArray = new float[3] - all in the class to contstruct the triangle.

I need to be able to access each pair of arrays from another class or draw function - so I assume I need to return them in the class…how do I do that correctly?

Here is a code:

```
Triangle triangle;
void setup() {
size(400, 400);
triangle = new Triangle ( width/2, height/2, 40);
}
void draw() {
background(88);
triangle.triangleDisplay();
}
// ---------------------------------------------
class Triangle {
float x, y, w, h;
float CSize;
float[] xArray = new float[3];
float[] yArray = new float[3];
Triangle( float posx, float posy, float tW) {
x = posx;
y = posy;
w = tW;
}
void triangleDisplay() {
float currentAngle = -HALF_PI;
float wr = w * 0.5;
for (int i = 0; i < 3; i++) {
xArray[i] = x + wr*cos(currentAngle);
yArray[i] = y + wr*sin(currentAngle);
//println(xArray[0], ",", yArray[0]);
fill(255);
currentAngle = currentAngle + radians (360 / 3);
}
triangle(xArray[0], yArray[0], xArray[1], yArray[1], xArray[2], yArray[2]);
}
}
```