{ "cells": [ { "cell_type": "markdown", "id": "29cf68fe", "metadata": {}, "source": [ "# formula1\n", "\n", "\n", "\n", "\n", "**Author:** Rene Brun \n", "This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Tuesday, May 19, 2026 at 08:37 PM." ] }, { "cell_type": "code", "execution_count": 1, "id": "5a86346e", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:37:05.249292Z", "iopub.status.busy": "2026-05-19T20:37:05.249079Z", "iopub.status.idle": "2026-05-19T20:37:05.633821Z", "shell.execute_reply": "2026-05-19T20:37:05.612511Z" } }, "outputs": [], "source": [ "TCanvas *c1 = new TCanvas(\"c1\", \"Example with Formula\", 200, 10, 700, 500);" ] }, { "cell_type": "markdown", "id": "083cfc9e", "metadata": {}, "source": [ "We create a formula object and compute the value of this formula\n", "for two different values of the x variable." ] }, { "cell_type": "code", "execution_count": 2, "id": "f5c3b42b", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:37:05.648455Z", "iopub.status.busy": "2026-05-19T20:37:05.648309Z", "iopub.status.idle": "2026-05-19T20:37:05.857959Z", "shell.execute_reply": "2026-05-19T20:37:05.857558Z" } }, "outputs": [], "source": [ "auto form1 = new TFormula(\"form1\", \"sqrt(abs(x))\");\n", "form1->Eval(2);\n", "form1->Eval(-45);" ] }, { "cell_type": "markdown", "id": "51787b05", "metadata": {}, "source": [ "Create a one dimensional function and draw it" ] }, { "cell_type": "code", "execution_count": 3, "id": "daa96c4b", "metadata": { "collapsed": false, "execution": { "iopub.execute_input": "2026-05-19T20:37:05.865402Z", "iopub.status.busy": "2026-05-19T20:37:05.865274Z", "iopub.status.idle": "2026-05-19T20:37:06.092247Z", "shell.execute_reply": "2026-05-19T20:37:06.091658Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "\n", "