A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://TheAlgorithms.github.io/C-Plus-Plus/de/d79/graham__scan__algorithm_8cpp_source.html below:

TheAlgorithms/C++: geometry/graham_scan_algorithm.cpp Source File

45#include "./graham_scan_functions.hpp" 52

std::vector<geometry::grahamscan::Point> points = {

53

{0, 3}, {1, 1}, {2, 2}, {4, 4}, {0, 0}, {1, 2}, {3, 1}, {3, 3}};

54

std::vector<geometry::grahamscan::Point> expected_result = {

55

{0, 3}, {4, 4}, {3, 1}, {0, 0}};

56

std::vector<geometry::grahamscan::Point> derived_result;

57

std::vector<geometry::grahamscan::Point> res;

59

derived_result = geometry::grahamscan::convexHull(points, points.size());

61

std::cout <<

"1st test: "

;

62 for

(

int

i = 0; i < expected_result.size(); i++) {

63

assert(derived_result[i].x == expected_result[i].x);

64

assert(derived_result[i].y == expected_result[i].y);

66

std::cout <<

"passed!"

<< std::endl;

static void test()

Self-test implementations.

int main()

Main function.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4