Graphic Delphi

Title: Rotate a Point in 3D
Procedure Rotate(Rx,Ry,Rz:Double; x,y,z:Double; Var Nx,Ny,Nz:Double);
Var TempX : Double;
TempY : Double;
TempZ : Double;
SinX : Double;
SinY : Double;
SinZ : Double;
CosX : Double;
CosY : Double;
CosZ : Double;
XRadAng: Double;
YRadAng: Double;
ZRadAng: Double;
Begin
XRadAng := Rx*PIDiv180;
YRadAng := Ry*PIDiv180;
ZRadAng := Rz*PIDiv180;
SinX := Sin(XRadAng);
SinY := Sin(YRadAng);
SinZ := Sin(ZRadAng);
CosX := Cos(XRadAng);
CosY := Cos(YRadAng);
CosZ := Cos(ZRadAng);
Tempy := y*CosY - z*SinY;
Tempz := y*SinY + z*CosY;
Tempx := x*CosX - Tempz*SinX;
Nz := x*SinX + Tempz*CosX;
Nx := Tempx*CosZ - TempY*SinZ;
Ny := Tempx*SinZ + TempY*CosZ;
End;
(* End Of *)