Back to index

wims  3.65+svn20090927
drawode_func.c
Go to the documentation of this file.
00001 #include "drawode.h"
00002 
00003 /* use nfunc in the outside world, so others don't depend on this file. */
00004 
00005 #define NFUNC 3
00006 
00007 const int nfunc=NFUNC;
00008 
00009 /* The famous example */
00010 static double dx_1(double x, double y)
00011 {
00012   return y;
00013 }
00014 
00015 static double dy_1(double x, double y)
00016 {
00017   return x*(x+y)+values[0]*x+values[1]*y;
00018 }
00019 
00020 /* Linear stuff */
00021 static double dx_2(double x, double y)
00022 {
00023   return values[0]*x+values[1]*y;
00024 }
00025 
00026 static double dy_2(double x, double y)
00027 {
00028   return values[1]*x+values[0]*y;
00029 }
00030 
00031 /* All kinds of linear things */
00032 static double dx_3(double x, double y)
00033 {
00034   return values[0]*x+values[1]*y;
00035 }
00036 
00037 static double dy_3(double x, double y)
00038 {
00039   return values[2]*x+values[3]*y;
00040 }
00041 
00042 
00043 
00044 func_t funcs[NFUNC][2]={{dx_1, dy_1}, {dx_2, dy_2}, {dx_3, dy_3}};