Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <math.h>
- #include <cstdio>
- #define _USE_MATH_DEFINES
- struct point
- {
- float x_pos;
- float y_pos;
- float _Hypot;
- float _Asin;
- };
- int main()
- {
- point a_point[4];
- a_point[0].x_pos = 300.0f;
- a_point[0].y_pos = 200.0f;
- a_point[1].x_pos = -200.0f;
- a_point[1].y_pos = 300.0f;
- a_point[2].x_pos = -300.0f;
- a_point[2].y_pos = -200.0f;
- a_point[3].x_pos = 200.0f;
- a_point[3].y_pos = -300.0f;
- int i;
- for( i = 0; i < 4; i++)
- {
- a_point[i]._Hypot = hypotf(a_point[i].y_pos, a_point[i].x_pos);
- a_point[i]._Asin = asinf(a_point[i].y_pos / a_point[i]._Hypot);
- printf("\nPOINT %d\n", i);
- printf("X Pos: %.1f\nY Pos: %.1f\nAsin : %.3f\n\n",
- a_point[i].x_pos, a_point[i].y_pos, a_point[i]._Asin);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement