main.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. **
  3. ** Copyright @ 2020 Joshua Branson <jbranso@member.fsf.org>
  4. **
  5. ** This program is free software; you can redistribute it and/or modify it
  6. ** under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation; either version 3 of the License, or (at
  8. ** your option) any later version.
  9. **
  10. ** It is distributed in the hope that it will be useful, but
  11. ** WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. **
  18. ** The goal of this program is to make a mini math library. The first
  19. ** objective is to find the distance between two points in the
  20. ** Cartesian X,Y plane.
  21. */
  22. #include <stdio.h>
  23. #include "structs.h"
  24. #include "distance.h"
  25. int main ()
  26. {
  27. /* struct x_y_point a = { 0.0, 0.0 }; */
  28. /* struct x_y_point b = { 1.0, 0.0 }; */
  29. struct x_y_point a;
  30. struct x_y_point b;
  31. a.x = 0.0;
  32. a.y = 0.0;
  33. b.x = 0.0;
  34. b.y = 1.0;
  35. double distance = get_distance (a, b);
  36. printf ("Distance between two points is %f\n", distance);
  37. return 0;
  38. }