public static GlobalFeatureVector computeGlobalFeatures(Signature s)
	{
		GlobalFeatureVector globVect = new GlobalFeatureVector();
		double totalLength = 0;
		double vxmoy = 0;
		double vymoy = 0;
		double vmoy = 0;
		double axmoy = 0;
		double aymoy = 0;
		double amoy = 0;
		double vmax = 0;
		double amax = 0;
		double angleSum = 0;
		double dxSum = 0;
		double dySum = 0;

		Point startPoint = s.getPoints().get(0);
		Point endPoint = s.getPoints().get(s.getPoints().size() - 1);
		double startEndDist = Math.sqrt(Math.pow(startPoint.getX() - endPoint.getX(), 2) + Math.pow(startPoint.getY() - endPoint.getY(), 2));
		double totalTime = endPoint.getTime() - startPoint.getTime();

		int i = 0;
		for (Point p : s.getPoints())
		{
			if (i < s.getPoints().size() - 1)
			{
				double dx = s.getPoints().get(i + 1).getX() - p.getX();
				double dy = s.getPoints().get(i + 1).getY() - p.getY();
				double eucliDist = Math.sqrt(dx * dx + dy * dy);

				double dt = s.getPoints().get(i + 1).getTime() - p.getTime();
				double dvx = 0;
				double dvy = 0;
				double dv = 0;
				double dax = 0;
				double day = 0;
				double da = 0;

				// Just in case, but shouldn't happen
				if (dt != 0) {
					dvx = dx / dt;
					dvy = dy / dt;
					dv = eucliDist / dt;
					dax = dvx / dt;
					day = dvy / dt;
					da = dv / dt;
				}

				dxSum += dx;
				dySum += dy;

				vxmoy += dvx;
				vymoy += dvy;
				vmoy += dv;
				axmoy += dax;
				aymoy += day;
				amoy += da;

				if (dv > vmax) {
					vmax = dv;
				}
				if (da > amax) {
					amax = da;
				}

				if (dx != 0)
					angleSum += Math.atan(dy / dx);
				else
					angleSum += Math.PI / 2;

				totalLength += eucliDist;
			}

			i++;
		}

		vxmoy /= s.getPoints().size() - 1;
		vymoy /= s.getPoints().size() - 1;
		vmoy /= s.getPoints().size() - 1;
		axmoy /= s.getPoints().size() - 1;
		aymoy /= s.getPoints().size() - 1;
		amoy /= s.getPoints().size() - 1;

		globVect.add(totalLength);
		globVect.add(totalTime);
		globVect.add(startEndDist);
		globVect.add(vxmoy);
		globVect.add(vymoy);
		globVect.add(vmoy);
		globVect.add(vmax);
		globVect.add(axmoy);
		globVect.add(aymoy);
		globVect.add(amoy);
		globVect.add(amax);
		globVect.add(angleSum);
		globVect.add(dxSum / dySum);

		return globVect;
	}