Thanks

#include<fstream.h> #include<stdlib.h> #include<math.h> double theta, theta_temp, y, z, ny, nz, ty, tz; int main() { cout <<endl <<" Enter Angle to Rotate: "; cin >>theta; cout <<endl <<" Enter Y Axis Machine Number for Centerline of Rotation: "; cin >>ty; cout <<endl <<" Enter Z Distance from Top of Setblock to Centerline of Rotation: "; cin >>tz; cout <<endl <<" Enter Distance from Centerline of Rotation to Work Offset Y0: "; cin >>y; cout <<endl <<" Enter Distance from Centerline of Rotation to Work Offset Z0: "; cin >>z; theta_temp = theta; theta = theta/180 * 3.1415926535897932384626433832795; ny = ny - ty; nz = nz - tz; ny = sin(theta) * z + cos(theta) * y; nz = cos(theta) * z - sin(theta) * y; ny = ny + ty; nz = nz + tz; cout <<endl <<endl <<" New Y and Z Coordinates Rotated " <<theta_temp <<" Degrees" <<endl; cout <<endl <<" Y = "<<ny; cout <<endl <<" Z = "<<nz <<endl <<endl <<endl; return 0; }

** Edit **

This post has been edited by **no2pencil**: 22 March 2009 - 10:07 PM