/** 2D & 3D グラフィックライブラリ Graph.cpp */ #include "Graph.h" using namespace jbxl; /** void jbxl::rotate_point(int& x, int& y, double xc, double yc, double cst, double snt) sxc - 回転前の座標の中心の X座標 syc - 回転前の座標の中心の Y座標 dxc - 回転後の座標の中心の X座標 dyc - 回転後の座標の中心の Y座標 */ void jbxl::rotate_point(int& x, int& y, double sxc, double syc, double dxc, double dyc, double cst, double snt) { double a, b, u, t; a = x - sxc; b = syc - y; u = a*cst - b*snt; t = a*snt + b*cst; x = (int)(u + dxc + 0.5); y = (int)(dyc - t + 0.5); return; } void jbxl::rotate_point_angle(int& x, int& y, double sxc, double syc, double dxc, double dyc, double th) { double cst = cos(th); double snt = sin(th); rotate_point(x, y, sxc, syc, dxc, dyc, cst, snt); return; }