00001 /*****************************************************************************\ 00002 * * 00003 * Name : test_ellipse * 00004 * Author : Chris Koeritz * 00005 * * 00006 * Purpose: * 00007 * * 00008 * Tests the ellipse class. * 00009 * * 00010 ******************************************************************************* 00011 * Copyright (c) 1993-$now By Author. This program is free software; you can * 00012 * redistribute it and/or modify it under the terms of the GNU General Public * 00013 * License as published by the Free Software Foundation; either version 2 of * 00014 * the License or (at your option) any later version. This is online at: * 00015 * http://www.fsf.org/copyleft/gpl.html * 00016 * Please send any updates to: fred@gruntose.com * 00017 \*****************************************************************************/ 00018 00019 #include <basis/guards.h> 00020 #include <basis/istring.h> 00021 #include <geometric/cartesian_objects.h> 00022 #include <geometric/ellipse.h> 00023 #include <geometric/point.cpp> 00024 #include <opsystem/application_shell.h> 00025 #include <data_struct/static_memory_gremlin.h> 00026 00027 HOOPLE_STARTUP_CODE; 00028 00029 using namespace geometric; 00030 00031 typedef cartesian_point e_point; 00032 00033 class test_ellipse : public application_shell 00034 { 00035 public: 00036 test_ellipse() : application_shell("t_ellipse") {} 00037 IMPLEMENT_CLASS_NAME("test_ellipse"); 00038 int execute(); 00039 }; 00040 00041 int test_ellipse::execute() 00042 { 00043 ellipse fred(e_point(20, 20), 5, 10); 00044 for (double i = 0; i < 360.0; i += 35.3) { 00045 e_point where(fred.location(double_angle(i, double_angle::DEGREES))); 00046 log(istring(istring::SPRINTF, "at angle %f ellipse is at ", i) 00047 + where.text_form()); 00048 } 00049 return 0; 00050 } 00051 00052 int main(int formal(argc), char *formal(argv)[]) 00053 { 00054 int to_return = test_ellipse().execute(); 00055 guards::alert_message("ellipse:: works for all functions tested."); 00056 return to_return; 00057 } 00058
1.5.1