Hi, this is more of a math/linear algebra question. In the pdf you need to find v in order to make everything work... where the heck is v coming from? I see the equations and all, but what does it all mean, and how would you write that in c++?

Code:
```#include <stdio.h>
#include <math.h>
#include <sys/syslimits.h>
#include <std.lib>

double determinant(double M);
double main(void)
{
char filename[PATH_MAX+1];
printf("enter input file name =>");			/* prompt user for file name */
scanf("%s", filename);						/* store in filename[] buffer */

#define MAXPOINTS 100
int i, N;
double t[MAXPOINTS];
double y[MAXPOINTS];

FILE *f;									/* pointer to FILE (used for file I/O) */
f = fopen(filename, "r");					/* open input file for reading */

if (f == NULL)								/* fopen unsuccessful */
{
perror(filename);						/* print system error message */
exit(-1);								/* die */
}

for (i = 0; i < MAXPOINTS; i++)
if (fscanf(f, "%lf %lf", &t[i], &y[i]) != 2)
break;

fclose(f);
N = i;

double sumt, sumtt, sumttt, sumtttt;		/* sums for t, t^2, t^3, t^4 */
double sumy, sumty, sumtty;					/* sums for y, t*y, t^2*y */
double M[3][3], v[3];						/* system we are solving: Mx = v */
double x[3];								/* solution: x = [a b c] */

}

double determinant(double M[3][3]){

return ((-1)*M[2][0]*M[1][1]*M[0][2]+(-1)*M[2][1]*M[1][2]*M[0][0]+
(-1)*M[2][2]*M[1][0]*M[0][1]+M[0][0]*M[1][1]*M[2][2]+M[0][1]*M[1][2]*M[2][0]+
M[0][2]*M[1][0]*M[2][1]);

}

void solve(double M[3][3], double v[3], double x[3])
{
double det = determinant(M);
double A[3][3];

A[0][0]=v[0][0];
A[1][0]=v[1][0];
A[2][0]=v[2][0];

X[0]= determinant(A)/det;

X[1]= determinant(A)/det;

X[2]= determinant(A)/det;

}```
this is all that I have so far, and I know that I'm not done yet. Thanks for the help!
-Jonbuckets

2. What pdf?

EDIT: Ah ok.

3. > double determinant(double M);
This needs to match the definition of the function later on.

> double main(void)
Nope, main returns an int, not a double.
It makes a change from the usual "void main" crowd though

> and how would you write that in c++?
Apart from the mixing of declarations and statements, all of this could just as easily be C code.
Which language are you supposed to be using?

4. The code is stuff that I've written already. I'm writting the code in a c++ compiler, but we are only supposed to use the C laguage. The big part I'm confused with is how to find v, or what v even is, I just don't understand the math behind it. From there I can get everything else to work.

5. From reading the PDF, I would think v means velocity
For which there is an equation if you know the initial velocity and a number of acceleration/time measurements.