Drawing array of curves from PVector

change this

  FloatList xx;
  FloatList yy;
  ArrayList<FloatList> old_x;
  ArrayList<FloatList> old_y;

  Particle(PVector l) {
    float vector_scale = 0.05;//ector scaling factor, we want small steps
    
    FloatList xx = new FloatList();
    FloatList yy = new FloatList();
    ArrayList<FloatList> old_x = new ArrayList<FloatList>();
    ArrayList<FloatList> old_y = new ArrayList<FloatList>();

to this

  FloatList xx;
  FloatList yy;
  ArrayList<FloatList> old_x;
  ArrayList<FloatList> old_y;

  Particle(PVector l) {
    float vector_scale = 0.05;//ector scaling factor, we want small steps

    xx = new FloatList();
    yy = new FloatList();
    old_x = new ArrayList<FloatList>();
    old_y = new ArrayList<FloatList>();

also wouldn’t it be easier just to maintain an arraylist of PVectors instead of two seperate lists for each ordinate… just a thought.

1 Like