world lines.
Accelerometer and gyroscope data (X,Y,Z) recorded at an inertial frame of reference.
10 seconds of randomly selected data from 10.11.2017 at 5551'8'' N 417'26'' W.
 
Start time: 12:15:52 End time: 12:16:01.

 

Start time: 12:16:16 End time: 12:16:25.

 

Start time: 12:12:32 End time: 12:23:41.

 

Processing code:

PFont dateFont;
PFont timeFont;
Table table;
String date;
IntList axSample;
IntList aySample;
IntList azSample;
IntList gxSample;
IntList gySample;
IntList gzSample;
StringList timeSample;
final int sampleSize=10;
int RowCount; //total rows
int index; // random starting point
int end = index+9;
int [] axValues = new int [10];
int [] ayValues = new int [10];
int [] azValues = new int [10];
int [] gxValues = new int [10];
int [] gyValues = new int [10];
int [] gzValues = new int [10];

int margin;
float XSpacer;

int [] time = new int [10];
String times[];

PVector[] axPositions = new PVector [10];
PVector[] ayPositions = new PVector [10];
PVector[] azPositions = new PVector [10];
PVector[] gxPositions = new PVector [10];
PVector[] gyPositions = new PVector [10];
PVector[] gzPositions = new PVector [10];

int overallMinaX, overallMinaY, overallMinaZ, overallMaxaX, overallMaxaY, overallMaxaZ;
int overallMingX, overallMingY, overallMingZ, overallMaxgX, overallMaxgY, overallMaxgZ;

void setup() {
size(800, 300);
processData();
}

void draw () {
background(255);
drawGUI();
}

void processData() {
table=loadTable("10-11-2017-AGT.csv", "header");// change file name here
RowCount = table.getRowCount();
index = int(random(RowCount-sampleSize));
end = index+9;

int[] axValues = int(table.getStringColumn("ax"));
int[] ayValues = int(table.getStringColumn("ay"));
int[] azValues = int(table.getStringColumn("az"));
int[] gxValues = int(table.getStringColumn("gx"));
int[] gyValues = int(table.getStringColumn("gy"));
int[] gzValues = int(table.getStringColumn("gz"));

//time
timeSample = new StringList();
String [] times = table.getStringColumn("time");
timeSample.append(subset(times, index, sampleSize));

//AX
axSample = new IntList();
axSample.append(subset(axValues, index, sampleSize));
overallMinaX = min(subset(axValues, index, sampleSize));
overallMaxaX = max(subset(axValues, index, sampleSize));

//AY
aySample = new IntList();
aySample.append(subset(ayValues, index, sampleSize));
overallMinaY = min(subset(ayValues, index, sampleSize));
overallMaxaY = max(subset(ayValues, index, sampleSize));

//AZ
azSample = new IntList();
azSample.append(subset(azValues, index, sampleSize));
overallMinaZ = min(subset(azValues, index, sampleSize));
overallMaxaZ = max(subset(azValues, index, sampleSize));

//GX
gxSample = new IntList();
gxSample.append(subset(gxValues, index, sampleSize));
overallMingX = min(subset(gxValues, index, sampleSize));
overallMaxgX = max(subset(gxValues, index, sampleSize));

//GY
gySample = new IntList();
gySample.append(subset(gyValues, index, sampleSize));
overallMingY = min(subset(gyValues, index, sampleSize));
overallMaxgY = max(subset(gyValues, index, sampleSize));

//GZ
gzSample = new IntList();
gzSample.append(subset(gzValues, index, sampleSize));
overallMingZ = min(subset(gzValues, index, sampleSize));
overallMaxgZ = max(subset(gzValues, index, sampleSize));

//graph
margin = 50;
XSpacer = (width-margin-margin)/(time.length);

for (int i=0; i<time.length; i++) {

//AXvalues
float adjX = map(axValues[i], overallMinaX, overallMaxaX, 100, 140);
float yPosX = height-margin-adjX;
float xPosX = margin+(XSpacer * i);
axPositions[i] = new PVector (xPosX, yPosX);
//AYvalues
float adjY = map(ayValues[i], overallMinaY, overallMaxaY, 100, 140);
float yPosY = height-margin-adjY;
float xPosY = margin+(XSpacer * i);
ayPositions[i] = new PVector (xPosY, yPosY);
//AZvalues
float adjZ = map(azValues[i], overallMinaZ, overallMaxaZ, 100, 140);
float yPosZ = height-margin-adjZ;
float xPosZ = margin+(XSpacer * i);
azPositions[i] = new PVector (xPosZ, yPosZ);

//GXvalues
float gadjX = map(gxValues[i], overallMingX, overallMaxgX, 100, 140);
float gyPosX = height-margin-gadjX;
float gxPosX = margin+(XSpacer * i);
gxPositions[i] = new PVector (gxPosX, gyPosX);
//GYvalues
float gadjY = map(gyValues[i], overallMingY, overallMaxgY, 100, 140);
float gyPosY = height-margin-gadjY;
float gxPosY = margin+(XSpacer * i);
gyPositions[i] = new PVector (gxPosY, gyPosY);
//GZvalues
float gadjZ = map(gzValues[i], overallMingZ, overallMaxgZ, 100, 140);
float gyPosZ = height-margin-gadjZ;
float gxPosZ = margin+(XSpacer * i);
gzPositions[i] = new PVector (gxPosZ, gyPosZ);
}
}
void drawGUI() {
for (int i=0; i<axPositions.length; i++) {
stroke (200, 100);

if (i > 0) {
//AX
stroke(0);
line(axPositions[i].x, axPositions[i].y, axPositions[i-1].x, axPositions[i-1].y);
line(ayPositions[i].x, ayPositions[i].y, ayPositions[i-1].x, ayPositions[i-1].y);
line(azPositions[i].x, azPositions[i].y, azPositions[i-1].x, azPositions[i-1].y);
//GX
stroke(150);
line(gxPositions[i].x, gxPositions[i].y, gxPositions[i-1].x, gxPositions[i-1].y);
line(gyPositions[i].x, gyPositions[i].y, gyPositions[i-1].x, gyPositions[i-1].y);
line(gzPositions[i].x, gzPositions[i].y, gzPositions[i-1].x, gzPositions[i-1].y);
}
}

//DATE
String date = table.getString(0, 6);
dateFont = createFont("Arial Bold.ttf", 10);
textFont(dateFont);
fill(0);
text("Date "+date+" Start time:"+timeSample.get(0)+" End time:" + timeSample.get(9)+" Location: 55°51'8'' N 4°17'26''W", margin, margin);
}