Question: Could you help me put this in C++? Instructions In this lab, youll be given a file with a list of motion commands. With this,
Could you help me put this in C++?
Instructions
In this lab, youll be given a file with a list of motion commands. With this, print the points that result file. In the case of linear motions, print the starting position, and each point 1 inch away from the previous printed point. Always print the last point on the line. For example, if youre at (0, 0, 0) and need to move to (5.5, 5.5, 5.5) the following would be printed:
(0, 0, 0), (1, 1, 1), (2, 2, 2), (3, 3, 3), (4, 4, 4), (5, 5, 5), (5.5, 5.5, 5.5)
In the case of clockwise and counter-clockwise motions, print angles 10 apart. When youve completed all the motions, print each of the points in your program in a single array, such as:
[(0, 1, 2), (1, 2, 3), (2, 3, 4), (3, 4, 5)]
Command List
- Linear When incremental positioning is on, the object should move linearly in the X, Y, and Z axes by the distances provided. If absolute positioning is on, the object should move to the X, Y, and Z positions provided. If a parameter is omitted, ignore the motion in that axis.
- X X-axis parameter (float).
- Y Y-axis parameter (float).
- Z Z-axis parameter (float).
- Clockwise moves clockwise to the position specified by the X, Y, and Z coordinates. Only two parameters will be specified at a time (you dont need to worry about a clockwise motion in all 3 axes). Either R will be specified, or some combination of I, J, and K parameters will be specified.
- X X position to move to. (float)
- Y Y position to move to. (float)
- Z Z position to move to. (float)
- R Radius of the circle. (float)
- I distance between the current X position and the X position of the circles center
- I2.0 means current X position + 2, while I-2.0 means current X position - 2.
- J distance between the current Y position and the Y position of the circles center
- K distance between the current Z position and the Z position of the circles center
- Counterclockwise moves counterclockwise to the position specified by the X, Y, and Z coordinates. Otherwise, the same rules apply as clockwise.
- Coordinates supports two possible values to determine how linear commands act, incremental and absolute.
- Incremental switch linear motions to incremental if they are absolute. Else, do nothing.
- Absolute switch linear motions to absolute if they are incremental. Else, do nothing.
- Units supports two possible values to determine how distances and positions are interpreted, metric and imperial.
- Metric all positions and distances are in millimeters.
- imperial all positions and distances are in inches.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
