-
Notifications
You must be signed in to change notification settings - Fork 0
/
line.h
57 lines (39 loc) · 1.11 KB
/
line.h
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
#ifndef line_h
#define line_h
/*****************************************************************************
3D Line class
NAME:line.h
DATE:5/11/1996
AUTHOR: Z.A. Nolan
*****************************************************************************/
// include input output
#include <iostream.h>
// include the vector class
#include "vector.h"
class TLine
{
private:
TVector _StartPoint ; // Start point of the line
TVector _EndPoint ; // end point of the line
public:
// Constructors
TLine () {}
// A line between two points
TLine (const TVector &StartPoint,const TVector &EndPoint) ;
// Selectors
// get the start point
TVector StartPoint() const ;
// get the end point
TVector EndPoint() const ;
// Modifiers
// get the distance to a point
double Distance (const TVector &Point) const ;
// get the distance to a line
double Distance (const TLine &Line) const ;
// invert a line
TLine operator-() const ;
// output
friend ostream &operator<<(ostream &Out,const TLine &Line) ;
friend istream &operator>>(istream &In,TLine &Line) ;
} ;
#endif