Given two spheres, I need to determine if a collision has occurred between them. I need to input the radii and the centers from the screen and use a double-valued function (outside of the main program) for the distance formula.
What I have so far is
#include <iostream>
using namespace std;
//Function prototype
double DistanceBetween( double x1, double y1, double z1, double x2, double y2, double z2 );
void main()
{
//center point and radius of first sphere
double x1, y1, z1, r1;
cout << "Please enter the data for the first sphere:" << endl;
cout << "x: ";
cin >> x1;
cout << "y: ";
cin >> y1;
cout << "z: ";
cin >> z1;
cout << "r: ";
cin >> r1;