The math class will be a very important part of our final program. The math class has various math related functions that can help us. There are functions that can compute the sin, cos, and tan of an angle. In our physics program these can be used to find the direction of vectors and the magnitude of their components. The class also contains functions that compute the square roots and exponents. These would be important because a lot of physics problems contain exponents and square roots. The class contains different functions for rounding which would allow the user to choose what place to round the answer to. The picture shows a simple code that computes the value of the square root of 4. The math class will be very helpful in creating our final program.
No comments:
Post a Comment