The finite element method using deal.II - 2021/2022
pythagoras.cc File Reference
#include <deal.II/base/point.h>
#include <gtest/gtest.h>
Include dependency graph for pythagoras.cc:

Go to the source code of this file.

Functions

 TEST (Pythagoras, Norm)
 
 TEST (Pythagoras, Distance)
 
 TEST (Pythagoras, ScalarProduct)
 
int main (int argc, char *argv[])
 

Function Documentation

◆ TEST() [1/3]

TEST ( Pythagoras  ,
Norm   
)

Definition at line 8 of file pythagoras.cc.

9 {
10  Point<2> x(3, 4);
11  ASSERT_EQ(x.norm(), 5);
12 }

◆ TEST() [2/3]

TEST ( Pythagoras  ,
Distance   
)

Definition at line 15 of file pythagoras.cc.

16 {
17  Point<2> x(4, 5);
18  Point<2> y(1, 1);
19  ASSERT_EQ(x.distance(y), 5);
20 }

◆ TEST() [3/3]

TEST ( Pythagoras  ,
ScalarProduct   
)

Definition at line 23 of file pythagoras.cc.

24 {
25  Point<2> x(3, 4);
26  ASSERT_EQ(x * x, 25);
27 }

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 31 of file pythagoras.cc.

32 {
33  testing::InitGoogleTest(&argc, argv);
34  return RUN_ALL_TESTS();
35 }
Point< 2 >