Here is the function to get the amount of units (you still need to multiply that with the ore unit volume) in an astroid, based on the radius. Ofc it only applies if the astroid isn't partially mined yet, but I found that to be very rare.
Code:
public static double CalculateAstroidUnits(double ifRadius)
{
double tfUnitCount = 0.0;
// Calculate the unit size based on the radius formula.
tfUnitCount += (-2.1428304552018226E+03 * Math.Atan(ifRadius));
tfUnitCount += (2.5003119349589870E+04 * Math.Log(ifRadius));
tfUnitCount += (2.5013413773803492E+00 * Math.Sin(ifRadius));
tfUnitCount += (3.8313177601871424E+00 * Math.Cos(ifRadius));
tfUnitCount += (-1.0906687489673198E+05);
// Return the amount of units in the astroid.
return tfUnitCount;
}
Last edited: