C++ need a formula in my coding

Below my coding print out a graph and changes the marker style and color.

Next I have to Replace the (100*exp(-x/1) (shown in my coding below) and replace it with the one for "Nuclear Decay" formula. I do not know the Nuclear Decay formula. Can someone help me.

#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <cmath>
#include <iomanip>
#include <cstdio>

#include "TROOT.h"
#include "TCanvas.h"
#include "TGraph.h"
#include "TApplication.h"
#include "TRint.h"
#include "TF1.h"

using namespace std;
#define NPOINTS 1000


int main(int argc, char **argv){

//ROOT stuff
TRint theApp("App",&argc,argv);
TCanvas *c = new TCanvas("c", "Solution", 400, 400);
TF1 *f=new TF1("fun","100*exp(-x/1)",0,5);
f->SetLineColor(3);
f->Draw();

TF1 *f2=new TF1("fun","100*exp(-x/1)",0,5);


c->Update();
theApp.Run();
}



Last edited on
Topic archived. No new replies allowed.