18#include <ROOT/RLine.hxx>
29 for (
double i = 0; i < 360; i += 1) {
31 RColor col(50 + (
int)i / 360 * 200, 0, 0);
32 auto draw = canvas->Draw<RLine>();
33 draw->SetP1({0.5_normal, 0.5_normal});
34 draw->SetP2({0.5_normal + 0.3_normal *
TMath::Cos(angle), 0.5_normal + 0.3_normal *
TMath::Sin(angle)});
35 draw->line.color = col;
38 canvas->Draw<RLine>()->SetP1({0.0_normal, 0.0_normal}).SetP2({1.0_normal, 1.0_normal});
39 canvas->Draw<RLine>()->SetP1({0.1_normal, 0.1_normal}).SetP2({0.9_normal, 0.1_normal});
40 canvas->Draw<RLine>()->SetP1({0.9_normal, 0.1_normal}).SetP2({0.9_normal, 0.9_normal});
41 canvas->Draw<RLine>()->SetP1({0.9_normal, 0.9_normal}).SetP2({0.1_normal, 0.9_normal});
42 canvas->Draw<RLine>()->SetP1({0.1_normal, 0.1_normal}).SetP2({0.1_normal, 0.9_normal});
43 canvas->Draw<RLine>()->SetP1({0.0_normal, 1.0_normal}).SetP2({1.0_normal, 0.0_normal});
45 canvas->SetSize(900, 700);
47 if (canvas->SaveAs(
"line.png"))
48 printf(
"Store RCanvas in line.png\n");
static std::shared_ptr< RCanvas > Create(const std::string &title)
Create new canvas instance.
Namespace for ROOT features in testing.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.