Search 11:08 PM 49%, Expert Q&A; Done K sent This is a C++ program. tions tosat
ID: 3781232 • Letter: S
Question
Search 11:08 PM 49%, Expert Q&A; Done K sent This is a C++ program. tions tosat a point to location shift as point a ghen amount along one of the and to retrieve the coordinates of a paint member function the point by a a claw that specified angle a can be to keep the of trigonamaty. Suppose you have point with coor- consider the point draw the top of the umn The point shown there haw three clockwika) by an angle point have new coordinata, which we' all a', y and a .The egations for the new coordinates uue the oath li- brary sin and cos, sham After aExplanation / Answer
class Rotation
{
double x,y,z,t;
Rotation(double x,double y, double z)
{
this.x=x;
this.y=y;
this.z=z;
}
void xRot(double t)
{
this.t=t;
this.x=x;
this.y=y*cos(t)-z*sin(t)
this.z=z*cos(t)+y*sin(t)
}
void yRot(double t)
{
this.t=t;
this.y=y;
this.x=x*cos(t)+z*sin(t);
this.z=;z*cos(t)-x*sin(t);
}
void zRot(double t)
{
this.t=t;
this.x=x*cos(t)-y*sin(t);
this.z=z;
this.y=y*cos(t)+x*sin(t);
}
main()
{
take x,,y,z co-irdinates from the user
Rotation x=new Rotation(x,y,z);
based on the base axis about which user rotate the cube compute
x.xRot(t);
or
x.yRot(t);
or
x.zRot(t);
keep this in util ser exits rotation
}
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.