Last active
July 28, 2017 01:16
-
-
Save benajaero/5a029bc0a0347c29338b8498add88dae to your computer and use it in GitHub Desktop.
A little library I made for my maths homework because I'm lazy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cmath> | |
#include <iostream> | |
struct Point { | |
double x; | |
double y; | |
}; | |
double distLength(struct Point point1,struct Point point2) { | |
double xlength = point1.x - point2.x, ylength = point1.y - point2.y; | |
return std::sqrt(xlength * xlength + ylength * ylength); | |
} | |
struct Point midpoint(struct Point point1, struct Point point2) { | |
struct Point point; | |
point.x = (point1.x + point2.x) / 2; | |
point.y = (point1.y + point2.y) / 2; | |
return point; | |
} | |
int main(void) { | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment