Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<math.h>
- typedef struct{
- int x,y;
- }Point;
- typedef struct{
- int amount;
- Point *points;
- }Path;
- int main(){
- Path p;
- path_input(&p);
- printf("Path Distance = %.2f\n",path_distance(&p));
- path_clear(&p);
- return 0;
- }
- void path_input(Path *p){
- int i,amount;
- printf("point amount: ");
- scanf("%d",p->amount);
- for(i=0;i<amount;i++){
- printf(" %2d.",i+1);
- }
- }
- void point_input(Point *p){
- printf("(x,y):");
- }
- void path_clear(Path *p){
- }
- float path_distance(Path *p){
- int i;
- float total = 0.0;
- return total;
- }
- float line_distance(Point *p1,Point *p2){
- return sqrt(pow(p1->x - p2->x,2)+pow(p1->y -p2->y,2));
- }
Advertisement
Add Comment
Please, Sign In to add comment