int main (void) {
        // Print welcome message
        printf("Welcome to the MOTION EQUATION CALCULATOR\n\n");

        // Variable for the user choice menu.
        int user_choice;

	do
	{
		user_choice = user_menu();  // print menu, validate choice is between 1 and 5

		// You will pass the address of this variable to your equation functions. 
		float result;               // Variable to hold calculated result

		// Handle menu choice selected by user
		switch( user_choice ) {
		case 1:
			equation1(&result);
			break;
		case 2:
			equation2(&result);
			break;
		case 3:
			equation3(&result);
			break;
		case 4:
			equation4(&result);
			break;
		case 5:
			// exit program if user selected QUIT
			printf("Thank you for using the MOTION EQUATION CALCULATOR. Goodbye.\n");
			return 0;
			break;
		}

		// Print out the calculated result with four digits after the decimal place
		printf("Your result is %.4f.\n\n", result);


        } while ( user_choice != 5 );

	return 0; // exit with no error
}
void equation3(double *x, double *y, double *z, double a1, double b1, double c1, double d1, double a2, double b2, double c2, double d2, double a3, double b3, double c3, double d3)
{
equation2(x, y, a1 * c2 - a2 * c1, b1 * c2 - b2 * c1, d1 * c2 - d2 * c1, a1 * c3 - a3 * c1, b1 * c3 - b3 * c1, d1 * c3 - d3 * c1);
*z = (d1 - a1 * *x - b1 * *y) / c1;
return;
}