MCPcopy Create free account
hub / github.com/cp-algorithms/cp-algorithms / main

Function main

test/test_line_intersection.cpp:7–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include "line_intersection.h"
6
7int main() {
8 pt res;
9 line m{1, -1, 2}; // y = x + 2
10 line n{-0.5, -1, 4}; // y = -0.5x + 4
11 assert(intersect(m, n, res));
12 assert(abs(res.x - 4. / 3.) < 1e-7);
13 assert(abs(res.y - 10. / 3.) < 1e-7);
14}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected