2) In the C Shell one can not do floating point operations. That is, you can not
ID: 3872394 • Letter: 2
Question
2) In the C Shell one can not do floating point operations. That is, you can not do math with real numbers. However, it is sometimes necessary to do so. A quick work around is to do the math inside a program like the basic calculater (e.g., use: be -l). This is by no means an elegant solution, typically if we want to do math we use another programming language, but occasionally we just need to do some basic calculations inside a shell script. Later, when we learn GMT, you might instead choose to use gmtmath. But for now, write a shell script that will allow you to do a simple calculation on floating point numbers. Take as input a coordinate position in polar coordinates (Radius, and angle theta in degrees) and output the equivalent Cartesian coordinate position. Hint, do something like the example shown earlier in this lecture. E.g, something like: be-1Explanation / Answer
ANSWER::
N1 G20
G0 G40 G49 G50 G80 G94 G90
N2 G17
N3 G00 X0 Y0 S900 M03
N4 G43 Z1.0 H01 M08
N5 G16
N6 G99 G81 X8 Y0 R0.1 Z-0.163 F3.0
N7 X8 Y60.0
N8 X8 Y120.0
N9 X8 Y180.0
N10 X8 Y240.0
N11 X8 Y300.0
N12 G15
N13 G80 M09
N14 G91 G28 Z0 M05
N15 G28 X0 Y0
N16 M30
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.