Hey I'm new here. I'm a bit new with Processing, and I'm trying to figure out this one issue. The program is suppose to create a dragon fractal image from an array, but when I enter into a certain function it calls "NullPointerException" on me. Here's my code:
// this is in a separate tab if that changes anything
class Point {
float x, y;
Point (float x_, float y_) {
x = x_;
y = y_;
}
}
Point rotate_point (Point r, Point p, float angle) {
Point old = new Point (p.x - r.x, p.y - r.y);
Point newp = new Point (old.x * cos (angle) - old.y * sin (angle) + r.x, old.x * sin (angle) + old.y * cos (angle) + r.y);
return newp;
}
Point [] dragon (Point [] p, float angle, int current, int depth) {
if (!(current > depth)) {
Point [] newp = new Point [p.length * 2 - 1];
for (int i = 0; i < p.length; i++) {
newp [i] = p [i];
}
for (int i = p.length + 1; i < newp.length; i++) {