00001
00020 #ifndef QUADRATC_H
00021 #define QUADRATC_H
00022
00023 #include "points.h"
00024
00029 class QUAD_COEFFS
00030 {
00031 public:
00032 QUAD_COEFFS() {
00033 }
00034 QUAD_COEFFS(
00035 double xsq,
00036 float x,
00037 float constant) {
00038 a = xsq;
00039 b = x;
00040 c = constant;
00041 }
00042
00043 float y(
00044 float x) const {
00045 return (float) ((a * x + b) * x + c);
00046 }
00047
00048 void move(
00049 ICOORD vec) {
00058 INT16 p = vec.x ();
00059 INT16 q = vec.y ();
00060
00061 c = (float) (c - b * p + a * p * p + q);
00062 b = (float) (b - 2 * a * p);
00063 }
00064
00065 double a;
00066 float b;
00067 float c;
00068 private:
00069 };
00070 #endif