-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.cpp
More file actions
63 lines (40 loc) · 1.18 KB
/
Copy pathtest.cpp
File metadata and controls
63 lines (40 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#pragma hdrstop
#pragma argsused
#ifdef _WIN32
#include <tchar.h>
#else
typedef char _TCHAR;
#define _tmain main
#endif
#include <stdio.h>
#include <conio.h>
#include <iostream>
#include "Vectors.h"
void FindIntersect();
int _tmain(int argc, _TCHAR* argv[])
{
Segment3D sa, sb;
Vector3D v;
std::cout << "Enter x y z of segment A start: ";
std::cin >> sa.start.X >> sa.start.Y >> sa.start.Z;
std::cout << "Enter x y z of segment A end: ";
std::cin >> sa.end.X >> sa.end.Y >> sa.end.Z;
std::cout << "Enter x y z of segment B start: ";
std::cin >> sb.start.X >> sb.start.Y >> sb.start.Z;
std::cout << "Enter x y z of segment B end: ";
std::cin >> sb.end.X >> sb.end.Y >> sb.end.Z;
switch(Intersect(sa,sb,v))
{
case IntersectionResult::Ok:
std::cout << "Intersection at " <<v.X<<":"<<v.Y<<":"<<v.Z;
break;
case IntersectionResult::Parallel:
std::cout << "Segmets are parallel"; break;
case IntersectionResult::NotInPlane:
std::cout << "Segmets are not in plane"; break;
case IntersectionResult::NoIntersection:
std::cout << "Segmets not intersecting"; break;
}
getch();
return 0;
}