1114 - #include #include using namespace...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#include<iostream> #include<cmath> using namespace std; &¶ï¼“ ay'- ay = ax' - ax int ax, ay, bx, by; double len, dis, ran; void fun(){ if(ay != by){ dis += abs(by - ay) * ran; } return; } int t, x, y; if(ax > bx){ t = ax, ax = bx, bx = t; t = ay, ay = by, by = t; } y = bx + by - ax; dis += ran * (ay - y + bx - ax); dis += ran * (bx - ax); } y = ax - bx + by; dis += ran * (y - ay + bx - ax); dis += ran * (bx - ax); } } } inline double dist(double x, double y, double a, double b){ return sqrt((a-x)*(a-x) + (b-y)*(b-y));
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/18/2010 for the course CS 100 taught by Professor Acm during the Spring '10 term at Zhejiang University.

Page1 / 2

1114 - #include #include using namespace...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online