Home | Develop | Download | Contact
example_triangle_create.cpp
1
19#include <cmath>
20#include <Pds/Ra>
21
22int main(void)
23{
24 Pds::Point2D p1(0,0);
25 Pds::Point2D p2(2,0);
26 Pds::Point2D p3(0,2);
27
28 Pds::Triangle T1(p1,p2,p3);
29 T1.Print("T: ");
30 T1.PrintStylized("T: ");
31
32 std::cout<<"area:"<<T1.GetArea()<<"\n";
33
34 std::cout<<"T1.IsInside(0.5,0.5):"<<T1.IsInside(0.5,0.5)<<"\n";
35 std::cout<<"T1.IsInside(0.0,1.0):"<<T1.IsInside(0.0,1.0)<<"\n";
36 std::cout<<"T1.IsInside(0.0,2.0):"<<T1.IsInside(0.0,2.0)<<"\n";
37 std::cout<<"T1.IsInside(2.0,2.0):"<<T1.IsInside(2.0,2.0)<<"\n";
38
39 std::cout<<"T1.IsInside(Pds::Point2D(0.5,0.5)):"<<T1.IsInside(Pds::Point2D(0.5,0.5))<<"\n";
40 std::cout<<"T1.IsInside(Pds::Point2D(0.0,1.0)):"<<T1.IsInside(Pds::Point2D(0.0,1.0))<<"\n";
41 std::cout<<"T1.IsInside(Pds::Point2D(0.0,2.0)):"<<T1.IsInside(Pds::Point2D(0.0,2.0))<<"\n";
42 std::cout<<"T1.IsInside(Pds::Point2D(2.0,2.0)):"<<T1.IsInside(Pds::Point2D(2.0,2.0))<<"\n";
43
44 std::cout<<"T1.Evaluate(0.5,0.5):"<<T1.Evaluate(0.5,0.5)<<"\n";
45 std::cout<<"T1.Evaluate(0.0,1.0):"<<T1.Evaluate(0.0,1.0)<<"\n";
46 std::cout<<"T1.Evaluate(0.0,2.0):"<<T1.Evaluate(0.0,2.0)<<"\n";
47 std::cout<<"T1.Evaluate(2.0,2.0):"<<T1.Evaluate(2.0,2.0)<<"\n";
48
49 std::cout<<"T1.Evaluate(Pds::Point2D(0.5,0.5)):"<<T1.Evaluate(Pds::Point2D(0.5,0.5))<<"\n";
50 std::cout<<"T1.Evaluate(Pds::Point2D(0.0,1.0)):"<<T1.Evaluate(Pds::Point2D(0.0,1.0))<<"\n";
51 std::cout<<"T1.Evaluate(Pds::Point2D(0.0,2.0)):"<<T1.Evaluate(Pds::Point2D(0.0,2.0))<<"\n";
52 std::cout<<"T1.Evaluate(Pds::Point2D(2.0,2.0)):"<<T1.Evaluate(Pds::Point2D(2.0,2.0))<<"\n";
53}
La clase tipo Pds::Point2D . Esta clase genera un objeto con dos parametros X y Y....
Definition: Point2D.hpp:59
La clase tipo Pds::Triangle . Esta clase genera un objeto con dos parĂ¡metros theta y rho....
Definition: Triangle.hpp:58

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed