18#include <ROOT/RLine.hxx>
27 auto canvas = RCanvas::Create(
"RLine example");
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});
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 canvas->SaveAs(
"line.png");
Option_t Option_t TPoint TPoint angle
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.