Go to Overview over all GrAL packages.
Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Geometry/internal/test-primitives.C

Go to the documentation of this file.
00001 #ifndef GRAL_GB_GEOMETRY_TEST_PRIMITIVES_C
00002 #define GRAL_GB_GEOMETRY_TEST_PRIMITIVES_C
00003 
00004 #include "Geometry/test-primitives.h"
00005 #include "Geometry/algebraic-primitives.h"
00006 
00007 #include "Utility/pre-post-conditions.h"
00008 
00009 
00010 template<class POINT>
00011 void test_algebraic_primitives<POINT>::do_tests(std::ostream& out)
00012 {
00013   typedef point_traits<POINT>         pt;
00014   typedef algebraic_primitives<POINT> ap;
00015 
00016   typename pt::Ptype p1 = pt::Origin(3);
00017   int li = pt::LowerIndex(p1); // should be the same for all points
00018 
00019   POINT e[3];
00020   for(int i = 0; i < 3; ++i) {
00021     e[i] = pt::Origin(3);
00022     e[i][li + i] = 1;
00023   }
00024 
00025   for(int i = 0; i < 3; ++i) {
00026     int j = (i < 2 ? i+1 : 0);
00027     int k = (i > 0 ? i-1 : 2);
00028     out << "ap::dot(p1,  e[" << i << "]) = " << ap::dot(p1,  e[i]) << '\n'
00029         << "ap::dot(e["<<i<<"],e["<<i<<"]) = " << ap::dot(e[i],e[i]) << '\n'
00030         << "ap::dot(e["<<k<<"],e["<<i<<"]) = " << ap::dot(e[k],e[i]) << '\n'
00031         << "ap::dot(e["<<j<<"],e["<<i<<"]) = " << ap::dot(e[j],e[i]) << '\n'
00032         << "ap::cos_of_angle(e["<<i<<"],e["<<i<<"]) = " 
00033         << ap::cos_of_angle(e[i],e[i]) << '\n'
00034         << "ap::cos_of_angle(e["<<k<<"],e["<<i<<"]) = " 
00035         << ap::cos_of_angle(e[k],e[i]) << '\n'
00036         << "ap::cos_of_angle(e["<<j<<"],e["<<i<<"]) = " 
00037         << ap::cos_of_angle(e[j],e[i]) << '\n';
00038 
00039         
00040   }
00041 }
00042 
00043 
00044 #endif

Copyright (c) Guntram Berti 1997-2002. See the GrAL Homepage for up-to-date information.

Generated at Tue Feb 26 15:57:26 2002 for Geometry by doxygen 1.2.11-20011104 written by Dimitri van Heesch, © 1997-2000