|
Computational Geometry Algorithms Library
1.0
Computational Geometry Algorithms Library Documentation
|
#include <iostream>#include <bits/stdc++.h>

Go to the source code of this file.
Macros | |
| #define | ull unsigned long long |
| #define | pb push_back |
| #define | mp make_pair |
| #define | COLLINEAR 1 |
| #define | CLOCKWISE 2 |
| #define | ANTICLOCKWISE 3 |
Functions | |
| double | calcEuclidDistance (pair< double, double > fpoint, pair< double, double > spoint) |
| Euclidean Distance. More... | |
| int | orientation (pair< double, double > a, pair< double, double > b, pair< double, double > c) |
| Orientation. More... | |
| bool | orderedSort (pair< double, double > &f, pair< double, double > &s) |
| Comparator Function. More... | |
| bool | orderedYSort (pair< double, double > &f, pair< double, double > &s) |
| Comparator Function Sort by y coordinate. More... | |
| bool | orderByPolar (pair< double, double > &p1, pair< double, double > &p2) |
| Function to order with respect to polar Coordinates. More... | |
| void | printVectorData (int len, vector< pair< double, double > > v, string s) |
| Print Function. More... | |
| vector< pair< double, double > > | getData (char *filename) |
| Extract Data from Input File. More... | |
Variables | |
| vector< int > | indices |
| pair< double,double > | P0 |
| a double value which stores the centre about which polar ordering is to be done More... | |
| #define ANTICLOCKWISE 3 |
Macro defined for identifying 3 points that rotate anticlockwise
| #define CLOCKWISE 2 |
Macro defined for identifying 3 points that rotate clockwise
| #define COLLINEAR 1 |
Macro defined for identifying 3 collinear points
| #define mp make_pair |
Macro for making my typing life easier
| #define pb push_back |
Macro for making my typing life easier
| #define ull unsigned long long |
Macro for making my typing life easier
| double calcEuclidDistance | ( | pair< double, double > | fpoint, |
| pair< double, double > | spoint | ||
| ) |
| vector<pair<double, double> > getData | ( | char * | filename | ) |
Extract Data from Input File.
It extracts Data From a file and stores it in a vector for further calculation. Forms the base for getting Data.
| bool orderByPolar | ( | pair< double, double > & | p1, |
| pair< double, double > & | p2 | ||
| ) |
Function to order with respect to polar Coordinates.
function used by this algorithm to sort an array of points with respect to the first point in the vector.
| bool orderedSort | ( | pair< double, double > & | f, |
| pair< double, double > & | s | ||
| ) |
Comparator Function.
This function basically compares a pair of elements by the values of their x-coordinate and if x-xoordinate is equal then it checks for equality of y-coordinate
| bool orderedYSort | ( | pair< double, double > & | f, |
| pair< double, double > & | s | ||
| ) |
Comparator Function Sort by y coordinate.
This function basically compares a pair of elements by the values of their y-coordinate and if x-xoordinate is equal then it checks for equality of x-coordinate
| int orientation | ( | pair< double, double > | a, |
| pair< double, double > | b, | ||
| pair< double, double > | c | ||
| ) |
Orientation.
This function is used to calculate orientation of 3 points namely clockwise, anticlockwise and collinear. The idea here is to to get the difference between slopes of 2 lines by assuming a particular direction as a result the result obtained determines the direction of turn of the three points.
| void printVectorData | ( | int | len, |
| vector< pair< double, double > > | v, | ||
| string | s | ||
| ) |
| vector<int> indices |
| pair<double ,double > P0 |
a double value which stores the centre about which polar ordering is to be done
1.8.11