feat: add quiz 3 cross-checker.
This commit is contained in:
24
cross-checker/main.cpp
Normal file
24
cross-checker/main.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <cross-checker.h>
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
if (argc != 9)
|
||||
{
|
||||
std::cout << "ERROR: 4 point must be provided" << std::endl;
|
||||
}
|
||||
|
||||
cross_checker::Line line1(cross_checker::Point(std::stod(argv[1]), std::stod(argv[2])), cross_checker::Point(
|
||||
std::stod(argv[3]), std::stod(argv[4])));
|
||||
cross_checker::Line line2(cross_checker::Point(std::stod(argv[5]), std::stod(argv[6])), cross_checker::Point(
|
||||
std::stod(argv[7]), std::stod(argv[8])));
|
||||
|
||||
if (line1.intersect(line2))
|
||||
{
|
||||
std::cout << "TRUE" << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "FALSE" << std::endl;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user