Question: Specify, design, and implement a class that can be used to keep track of the position of a point in three-dimensional space. For example, consider

 Specify, design, and implement a class that can be used to

Specify, design, and implement a class that can be used to keep track of the position of a point in three-dimensional space. For example, consider the point drawn at the top of the next column. The point shown there has three coordinates: x = 2.5, y = 0, and z 2.0. Include member functions to set a point to a specified location, to shift a point a given amount along one of the axes, and to retrieve the coordinates of a point. Also provide member functions that will rotate the point by a specified angle around a specified axis. To compute these rotations, you will need abit of trigonometry. Suppose you have a point with coordinates, x, y, and z. After rotating this point (counter-clockwise) by an angle theta, the point will have new coordinates, which we'll call x', y', and z'. The equations for the new coordinates use the c math library functions sin and cos, as shown here: After a a rotation around the x-axis: x' = x y' y cos(theta)-z sin(theta) z' = y sin(theta) +z cos(theta)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!