00001 00010 #include "Graph.h" 00011 00012 00013 using namespace jbxl; 00014 00015 00028 void jbxl::rotate_point(int& x, int& y, double sxc, double syc, double dxc, double dyc, double cst, double snt) 00029 { 00030 double a, b, u, t; 00031 00032 a = x - sxc; 00033 b = syc - y; 00034 u = a*cst - b*snt; 00035 t = a*snt + b*cst; 00036 x = (int)(u + dxc + 0.5); 00037 y = (int)(dyc - t + 0.5); 00038 00039 return; 00040 } 00041 00042 00043 00055 void jbxl::rotate_point_angle(int& x, int& y, double sxc, double syc, double dxc, double dyc, double th) 00056 { 00057 double cst = (double)cos(th); 00058 double snt = (double)sin(th); 00059 00060 rotate_point(x, y, sxc, syc, dxc, dyc, cst, snt); 00061 00062 return; 00063 } 00064 00065