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

Function main

test/test_geometry.cpp:11–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include "dotproperties.h"
10
11int main() {
12 point2d a(1, 2);
13 point2d b(3, 4);
14 a += b;
15 assert(a.x == 4 && a.y == 6);
16 a -= b;
17 assert(a.x == 1 && a.y == 2);
18 a *= 2;
19 assert(a.x == 2 && a.y == 4);
20 assert(dot(a, b) == 22);
21
22 point3d A(1, 2, 3);
23 point3d B(4, 5, 6);
24 assert(dot(A, B) == 32);
25
26 point2d pyt(3, 4);
27 assert(norm(pyt) == 25);
28 assert(abs(pyt) == 5);
29}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected